0

I have a setup which uses the ESP8266 12E and it opens a web server at a specific port 200. I have used the port forwarding to route the incoming data to this server .And I have used the duckdns to register the IP and call the duckdns domain to trigger the ESP. This works fine and I am able to trigger using the following

http://mydomain.duckdns.org:200/parseIFTTT

Using the postman tool, with the contentType as plain/text and the method as POST what ever contents I pass are getting parsed by parseIFTTT method in the ESP

 void parseIFTTT() {

  String message;
  message += server.args();
  message += "\n";
  for (uint8_t i = 0; i < server.args(); i++) {
    message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
  }
  Serial.println(message);
  server.send(200, "text/plain", "Success");
}

But when tried to integrate with IFTTT for any Facebook or gmail events, I am not able to parse the data from IFTTT.

The request goes to ESP8266 but the request data I am not able to parse.

The following is the request :

URL : http://mydomain.duckdns.org:200/parseIFTTT
Method : POST
Content Type: text/plain
Body : {{Message}}

In the body I have just added the {{Message}} only. In the serial monitor I get the op as blank

1
plain:
rahulmr
  • 681
  • 1
  • 7
  • 19

1 Answers1

0

I found the issue after a lot of debugging.

The esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src\Parsing.cpp in the core library for the Http server was using the 'Content-Length' and IFTTT was sending the request header with name as "content-length' and hence the content length was not retrieved and the parsed data was not retrieved.

Not sure whether its an issue with the IFTTT where they send this as a lower cased value.

rahulmr
  • 681
  • 1
  • 7
  • 19