QuestionsNeed help with http request in esp8266
Nobster361 Staff asked 1 month ago

Hi beautiful community of ESP!

I am trying to send a http request from browser to the esp8266. Currently I have ESP8266WebServer running on the esp and listening to incoming http requests. I have a function which listens to request made by browser and activates a function example: if I type ‘http://ipofesp /ledon’ without space in the url; The ledon function will be called upon ‘/ledon’ in the url.

The code I am using is:

void setup(){

server.on(“/”,[](){server.send(200,”text/plain”,”Hello World”);});
server.on(“/ledon”,ledon);

server.onNotFound(handleNotFound);

}

void loop() {
server.handleClient();
}

void ledon(){

digitalWrite(D5, LOW)

}

void handleNotFound(){

server.send(200,”text/plain”,”Wrong input”);

}

This works file for me but now I am trying to send a http request from browser to the esp8266 with an http payload. How can I fetch the http payload in esp8266?

is there any built-in function in the server object?