I use the ESP8266 FSBrowser example.
But with following additions:
void testfunc(){
//Outch, there is no argument inside if zero.
if(server.args() == 0) return server.send(500, "text/plain", "BAD ARGS");
for (int x=0; x <= server.args(); x++) {
//print all arguments received in POST payload
DBG_OUTPUT_PORT.println(server.arg(x));
}
//Print out the amount of arguments received in POST payload
DBG_OUTPUT_PORT.println(server.args());
//Make the browser happy, send him something
server.send(200, "text/plain", "");
}
and this as callback definition located at the setup loop.
server.on("/test", HTTP_POST, testfunc);
I just get the values of the Payload variables.
I would like to get the names of the variables.
A example of my POST request is here:
nickname: "mynickname"
team: "red"
The code displayed above only outputs:
2
mynickname
red
But i would like to also get nickname and team
Thanks in advance