webserver.sendContent method equivalent for ESPAsyncWebServer?

t23319222
Posts: 11
Joined: Tue Mar 04, 2025 6:29 pm

webserver.sendContent method equivalent for ESPAsyncWebServer?

Postby t23319222 » Thu Apr 10, 2025 2:29 pm

Hi,

I would like to know if there is a method like sendContent, but for ESPAsyncWebServer instead of the normal (sync) Webserver? I have a project and would like to convert it to use ESPAsyncWebServer.h instead of the normal Webserver.h library, but unfortunately there are many lines webserver.sendContent(...) in there and I don't know with what equivalent function I can replace them when using ESPAsyncWebServer?

lbernstone
Posts: 1132
Joined: Mon Jul 22, 2019 3:20 pm

Re: webserver.sendContent method equivalent for ESPAsyncWebServer?

Postby lbernstone » Thu Apr 10, 2025 9:24 pm

There's more than one way to do it. The simplest is to construct your string first, and then use a basic send()
https://github.com/ESP32Async/ESPAsyncW ... ng-content

t23319222
Posts: 11
Joined: Tue Mar 04, 2025 6:29 pm

Re: webserver.sendContent method equivalent for ESPAsyncWebServer?

Postby t23319222 » Sat Apr 12, 2025 8:30 pm

What if the message is so large that it doesnt fit in the RAM of the ESP?

lbernstone
Posts: 1132
Joined: Mon Jul 22, 2019 3:20 pm

Re: webserver.sendContent method equivalent for ESPAsyncWebServer?

Postby lbernstone » Sun Apr 13, 2025 2:17 am

Please read the documentation. It explains how to send data from a stream or a file.

Who is online

Users browsing this forum: PetalBot, trendictionbot and 4 guests