esp32_https_server icon indicating copy to clipboard operation
esp32_https_server copied to clipboard

Respons Timeout

Open im-pro-at opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. If a client is slow or does not fetch the result the httpServer.loop() can take a long time to process! In a lot of situations we will just want to cancel the webrequest instat of waiting ...

Describe the solution you'd like

I would like a possibility to set a timeout for the HTTPResponse like that:

void handleRoot(HTTPRequest * req, HTTPResponse * res) { Serial.println("HTTP Handling root call!"); req->discardRequestBody(); res->setTimeout(5); //Set an timeout of 5 Secounds res->setHeader("Content-Type", "text/html"); res->print(INDEX_HTML); }

im-pro-at avatar Feb 17 '22 09:02 im-pro-at