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?
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.
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:
Hope this helps.