Hello all,
I have a snippet of my code below, it is a simple GET request to IFTTT which can trigger things. I have finally got it so the GET request works perfectly, but now I want to add some data.
void loop() {
// put your main code here, to run repeatedly:
if(WiFi.status() == WL_CONNECTED){
state = digitalRead(button);
if(state == 1){
HTTPClient http;
http.begin("");
http.begin("http://maker.ifttt.com/trigger/button_pressed/with/key/{my key here}");
int httpCode = http.GET();
digitalWrite(led, HIGH);
Serial.println("Button pressed!");
delay(1000);
digitalWrite(led, LOW);
state = 0;
if (httpCode > 0) {
String payload = http.getString();
Serial.println(payload);
}
http.end();
}
}
delay(25);
}
http.begin("Webhooks Integrations - Connect Your Apps with IFTTT{my key here}");
Above is the line of code that is my area of concern. This line works fine but if i go into my web browser and add the lines for adding up to 3 data values with IFTTT
Webhooks Integrations - Connect Your Apps with IFTTT{my key here}?value1=C1&value2=3.34
That line works perfectly when the values are added in.
So my question is, how can I write that line in arduino where I am doing the GET request such that the values are referencing variables that are constantly changing?
I have tried a few different ways, but I just can't figure out how to code it. The goal is to be able to run that GET request that updates the values with IFTTT.
Any help is greatly appreciated, thanks!!