I have an ESP8266 that I want to send off a GET request to ifttt.com to trigger an action. Here's the code that sends off the request:
WiFiClient client;
if (client.connect("maker.ifttt.com", 80)) {
Serial.println("Connected");
String url = "/trigger/trap_triggered/with/key/{key}";
Serial.print("requesting URL: ");
Serial.println(url);
client.print(String("GET ") + url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"Connection: close\r\n\r\n");
Serial.println("request sent");
}
*Note that in my actual code I've replaced {key} with my actual verified app key from ifttt.
The problem is that when the request gets sent off my ifttt service never receives it. I don't get any errors, everything seems to work fine on the ESP side. So I tested ifttt by putting the exact same request into a browser and it works perfectly every time. So it seems like my request is not making it from my ESP to ifttt.
Any thoughts on what the issue could be?