Completed

Esp8266 e Asyncwebserver - Erro no response

Published on the May 08, 2019 in IT & Programming

About this project

Open

Estou utilizando a library https://github.com/me-no-dev/ESPAsyncWebServer com o seguinte código abaixo e ao abrir a url com o método informado, o response NÃO é retornado, mas o ESP8266 restart.

WebServer.on("/wifi-config", HTTP_POST, [=](AsyncWebServerRequest * request)
    {
        if (request->hasHeader("X-Automa-Rede") && request->hasHeader("X-Automa-Senha")) {
            AsyncWebHeader* h_rede = request->getHeader("X-Automa-Rede");
            AsyncWebHeader* h_senha = request->getHeader("X-Automa-Senha");
            
            AsyncWebServerResponse* response = request->beginResponse(200, "text/plain", "Dispositivo | Configurações de rede salva. Reiniciando...");
            Response->addHeader("Connection", "close");
            request->send(response);

            ESP.restart();
        }
    });

Category IT & Programming
Subcategory Web development
What is the scope of the project? Small change or bug
Is this a project or a position? Project
I currently have I have specifications
Required availability As needed
API Integrations Other (Other APIs)
Roles needed Developer

Delivery term: May 09, 2019

Skills needed