Comments on: ESP32 HTTP POST with Arduino IDE (ThingSpeak and IFTTT.com) https://randomnerdtutorials.com/esp32-http-post-ifttt-thingspeak-arduino/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Sun, 20 Apr 2025 04:24:54 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Tim https://randomnerdtutorials.com/esp32-http-post-ifttt-thingspeak-arduino/#comment-1029004 Sun, 20 Apr 2025 04:24:54 +0000 https://randomnerdtutorials.com/?p=96830#comment-1029004 Very nice tutorial. Very helpful! Your POST request example above is not exactly correct. You should have the HTTP headers, followed by a blank line and then the forms or JSON data.

]]>
By: Naol https://randomnerdtutorials.com/esp32-http-post-ifttt-thingspeak-arduino/#comment-952382 Thu, 29 Aug 2024 07:07:37 +0000 https://randomnerdtutorials.com/?p=96830#comment-952382 In reply to Ale.

Make sure your URL is http not https. if you want to use https here is github link: https://github.com/Nmbwj/Esp-Project/tree/main/POST_Https ,to secure POST. There are also GET on the github. Please take look. Thanks to randomNerd we are able to increase our potential. Caution: to replace the APIKEY to your APIKEY, Wifi ssid and Wifi password.

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-http-post-ifttt-thingspeak-arduino/#comment-838092 Tue, 30 May 2023 21:20:43 +0000 https://randomnerdtutorials.com/?p=96830#comment-838092 In reply to jojo.

That’s great!
Thank you.
Regards,
Sara

]]>
By: jojo https://randomnerdtutorials.com/esp32-http-post-ifttt-thingspeak-arduino/#comment-837883 Mon, 29 May 2023 18:28:44 +0000 https://randomnerdtutorials.com/?p=96830#comment-837883 YOU ARE GREAT .. I LEARNED A LOT … A LOT .. A LOT FROM YOU

]]>
By: Ale https://randomnerdtutorials.com/esp32-http-post-ifttt-thingspeak-arduino/#comment-697072 Wed, 10 Nov 2021 19:09:54 +0000 https://randomnerdtutorials.com/?p=96830#comment-697072 Hi. I just did the example with ThingSpeak and i am getting the following message “HTTP Response code: -1”. What does it mean and how can i fix it?

]]>
By: Larry https://randomnerdtutorials.com/esp32-http-post-ifttt-thingspeak-arduino/#comment-565514 Wed, 03 Mar 2021 15:43:43 +0000 https://randomnerdtutorials.com/?p=96830#comment-565514 /*
Rui Santos
Complete project details at Complete project details at https://RandomNerdTutorials.com/esp32-http-post-ifttt-thingspeak-arduino/

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
*/

#include <WiFi.h>
#include <HttpClient.h>

char* ssid = “NETGEAR18”;
char* password = “crispybox986”;

// Domain Name with full URL Path for HTTP POST Request
const char* serverName = “http://api.thingspeak.com/update”;
// Service API Key
String apiKey = “161866”;

// THE DEFAULT TIMER IS SET TO 10 SECONDS FOR TESTING PURPOSES
// For a final application, check the API call limits per hour/minute to avoid getting blocked/banned
unsigned long lastTime = 0;
// Set timer to 10 minutes (600000)
//unsigned long timerDelay = 600000;
// Timer set to 10 seconds (10000)
unsigned long timerDelay = 10000;

void setup() {
Serial.begin(115200);

WiFi.begin(ssid, password);
Serial.println(“Connecting”);
while(WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(“.”);
}
Serial.println(“”);
Serial.print(“Connected to WiFi network with IP Address: “);
Serial.println(WiFi.localIP());
// Serial.print(“ESP Board MAC Address: “);
// Serial.println(WiFi.macAddress());
Serial.println(“Timer set to 10 seconds (timerDelay variable), it will take 10 seconds before publishing the first reading.”);

// Random seed is a number used to initialize a pseudorandom number generator
randomSeed(analogRead(33));
}

void loop() {
//Send an HTTP POST request every 10 seconds
if ((millis() – lastTime) > timerDelay) {
//Check WiFi connection status
if(WiFi.status()== WL_CONNECTED){
HttpClient http; //here is where I get the error of no matching function for call to HttpClient :: HttpClient

// Your Domain name with URL path or IP address with path
http.begin(serverName);

// Specify content-type header
http.addHeader("Content-Type", "application/x-www-form-urlencoded");
// Data to send with HTTP POST
String httpRequestData = "api_key=" + apiKey + "&field1=" + String(random(40));
// Send HTTP POST request
int httpResponseCode = http.POST(httpRequestData);

/*
// If you need an HTTP request with a content type: application/json, use the following:
http.addHeader("Content-Type", "application/json");
// JSON data to send with HTTP POST
String httpRequestData = "{\"api_key\":\"" + apiKey + "\",\"field1\":\"" + String(random(40)) + "\"}";
// Send HTTP POST request
int httpResponseCode = http.POST(httpRequestData);*/

Serial.print("HTTP Response code: ");
Serial.println(httpResponseCode);

// Free resources
http.end();
}
else {
Serial.println("WiFi Disconnected");
}
lastTime = millis();

}
}

]]>
By: Larry https://randomnerdtutorials.com/esp32-http-post-ifttt-thingspeak-arduino/#comment-563230 Fri, 26 Feb 2021 23:11:28 +0000 https://randomnerdtutorials.com/?p=96830#comment-563230 No matching function for the call to HttpClient also didn’t accept the const char , had to change it to char .

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-http-post-ifttt-thingspeak-arduino/#comment-562385 Thu, 25 Feb 2021 12:04:07 +0000 https://randomnerdtutorials.com/?p=96830#comment-562385 In reply to Larry.

Hi.
What’s the issue that you get after installing the right library?
Regards,
Sara

]]>
By: Larry https://randomnerdtutorials.com/esp32-http-post-ifttt-thingspeak-arduino/#comment-561998 Wed, 24 Feb 2021 18:19:49 +0000 https://randomnerdtutorials.com/?p=96830#comment-561998 I tried to load this ,I keep getting an error about HTTPClient ,noticed that it expected HttpClient so I changed that but still get error. No matching function, went to github and downloaded HttpClient master, installed it as a zip in include library but still issues.Help please

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-http-post-ifttt-thingspeak-arduino/#comment-501039 Mon, 28 Sep 2020 16:37:47 +0000 https://randomnerdtutorials.com/?p=96830#comment-501039 In reply to Donald Garber.

Hi.
You can learn more about our course and what’s included here: https://randomnerdtutorials.com/learn-esp32-with-arduino-ide/
Besides the content you also get unlimited future updated, access to our private forum and facebook group.
If you have any doubts about the course content, send an email using our form: https://randomnerdtutorials.com/contact/
Regards,
Sara

]]>