im trying to send some text using mit appinventor to my esp8266 so it will print it to serial using some example i find online it works with postman but with mit appinventor it shows nothing any help?
this is my code
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
ESP8266WebServer server(80);
const char* ssid = "****";
const char* password = "*******";
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password); //Connect to the WiFi network
while (WiFi.status() != WL_CONNECTED) { //Wait for connection
delay(500);
Serial.println("Waiting to connect...");
}
Serial.print("IP address: ");
Serial.println(WiFi.localIP()); //Print the local IP
server.on("/body", handleBody); //Associate the handler function to the path
server.begin(); //Start the server
Serial.println("Server listening");
}
void loop() {
(); //Handling of incoming requests
}
void handleBody() { //Handler for the body path
if (server.hasArg("plain")== false){ //Check if body received
server.send(200, "text/plain", "Body not received");
return;
}
String message = "Body received:\n";
message += server.arg("plain");
message += "\n";
server.send(200, "text/plain", message);
Serial.println(message);
}
this is my blocks
it works with post man
this is the serial output when im using postman
Body received:
test