Arduino-esp32: Webserver - How respond to HTTP POST request?

Created on 24 Aug 2017  路  5Comments  路  Source: espressif/arduino-esp32

I want to make a web server on my ESP32 that can host a HTML form and can submit data using POST method. Can anybody give me any idea how to do that with some sample code?

Most helpful comment

Not sure if anyone is still looking, but POST data can be retrieved with the String arg(String name) method as below:

void handlePost() {
    Serial.print("Data: ");
    Serial.println(server->arg("myData1"));
    Serial.print("Data: ");
    Serial.println(server->arg("myData2"));
}

Hope this helps.

All 5 comments

Yes thanks! Got it working with WebServer_tng library, but I guess there is no way of doing the same with official Webserver library.

Not sure if anyone is still looking, but POST data can be retrieved with the String arg(String name) method as below:

void handlePost() {
    Serial.print("Data: ");
    Serial.println(server->arg("myData1"));
    Serial.print("Data: ");
    Serial.println(server->arg("myData2"));
}

Hope this helps.

bot1131357, what library are you talking about?
Thanks

Just the WebServer from arduino-esp32. Here's a link to the examples.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maxpromer picture maxpromer  路  3Comments

lonerzzz picture lonerzzz  路  3Comments

DrewHoyt picture DrewHoyt  路  4Comments

N0rbert picture N0rbert  路  4Comments

merlinschumacher picture merlinschumacher  路  4Comments