Comments on: ESP32 HTTP GET and HTTP POST with Arduino IDE (JSON, URL Encoded, Text) https://randomnerdtutorials.com/esp32-http-get-post-arduino/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Sun, 18 May 2025 06:47:39 +0000 hourly 1 https://wordpress.org/?v=6.8.1 By: dekip https://randomnerdtutorials.com/esp32-http-get-post-arduino/#comment-1045462 Sun, 18 May 2025 06:47:39 +0000 https://randomnerdtutorials.com/?p=95443#comment-1045462 Just to add that after V3.x.x, every GET request returns -1 error HTTP code. Is there any fix for this?

]]>
By: Uziel https://randomnerdtutorials.com/esp32-http-get-post-arduino/#comment-1018006 Wed, 19 Mar 2025 16:32:37 +0000 https://randomnerdtutorials.com/?p=95443#comment-1018006 I have tried a variety of codes, been trying to GET/POST from my esp32 to my local Django REST API, but the esp32 just keeps giving me error code -1. 🙁

]]>
By: Jean-roch Blais https://randomnerdtutorials.com/esp32-http-get-post-arduino/#comment-954701 Sat, 07 Sep 2024 20:04:45 +0000 https://randomnerdtutorials.com/?p=95443#comment-954701 Sorry for posting this about a day or two:

“this code does not work ” … (It works, my bad …)

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

// If you need Node-RED/server authentication, insert user and password below
//http.setAuthorization("REPLACE_WITH_SERVER_USERNAME", "REPLACE_WITH_SERVER_PASSWORD");

// Send HTTP GET request
int httpResponseCode = http.GET();

jrb.

]]>
By: Talha https://randomnerdtutorials.com/esp32-http-get-post-arduino/#comment-933938 Thu, 04 Jul 2024 09:11:30 +0000 https://randomnerdtutorials.com/?p=95443#comment-933938 Hello!

I am sending the data to server using the following function, the problem is when the data from the sensors is small, it works fine and send all data to server like for one hour of data.
But when I increase the data size it does not send the data and doesn’t give any responsecode.
Can somebody assist?

void sendDataToServer(const String & payload) {
// Print the payload for debugging
Serial.println(“Payload to be sent to server:”);
Serial.println(payload);
HTTPClient http;
http.begin(serverName);
http.addHeader(“Content-Type”, “application/json”);

int httpResponseCode = http.POST(payload);

esp_task_wdt_reset(); // Reset the watchdog timer

if (httpResponseCode > 0) {
Serial.print(“HTTP Response code: “);
Serial.println(httpResponseCode);

String response = http.getString();
Serial.println(response);

} else {
Serial.print(“Error code: “);
Serial.println(httpResponseCode);
}

http.end();
}

]]>
By: Talha https://randomnerdtutorials.com/esp32-http-get-post-arduino/#comment-933937 Thu, 04 Jul 2024 09:05:54 +0000 https://randomnerdtutorials.com/?p=95443#comment-933937 In reply to G Reddy.

Hello
Have you find an answer to this? I’m also getting this -11 response although the server is okay?
And it occurs when I send large data file, on small data it works fine. why is it so?

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-http-get-post-arduino/#comment-907046 Wed, 17 Apr 2024 22:09:48 +0000 https://randomnerdtutorials.com/?p=95443#comment-907046 In reply to John Pool.

Hi.
That’s great.
Thanks for sharing.
Regards,
Sara

]]>
By: John Pool https://randomnerdtutorials.com/esp32-http-get-post-arduino/#comment-907033 Wed, 17 Apr 2024 20:58:01 +0000 https://randomnerdtutorials.com/?p=95443#comment-907033 Thank you for your lessons. I borrowed shamelessly from them to create this project

github.com/spudwoot/ESP32-Service-Now-Temp-Monitor

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-http-get-post-arduino/#comment-901224 Wed, 27 Mar 2024 10:53:03 +0000 https://randomnerdtutorials.com/?p=95443#comment-901224 In reply to Jose Serena.

Hi.
Thanks for sharing.
I’ll take a look.
Regards,
Sara

]]>
By: Jose Serena https://randomnerdtutorials.com/esp32-http-get-post-arduino/#comment-901079 Tue, 26 Mar 2024 19:49:09 +0000 https://randomnerdtutorials.com/?p=95443#comment-901079 Hi Sara,

I have started with NTFY, see https://docs.ntfy.sh/, and I have used this article as a base to publish notifications from an ESP32.

I think NTFY is easy and powerful. It’s free and, if you are concerned about privacy, you can install your own NTFY server. I installed and configured mine in about one hour using a Docker image.

Surely you can write a very interesting article about this service.

]]>
By: Mike https://randomnerdtutorials.com/esp32-http-get-post-arduino/#comment-896802 Thu, 07 Mar 2024 00:48:38 +0000 https://randomnerdtutorials.com/?p=95443#comment-896802 Hi Sara,
All of your tutorials are terrific and I have used many of your examples as the basis of my projects.
I was trying to POST a webhook to Zapier using some of the code in this tutorial.
In this part of the tutorial:
3. ESP32 HTTP POST: URL Encoded, JSON Data Object, Plain Text
The first example had this to initialize HTPP:
// Your Domain name with URL path or IP address with path
http.begin(client, serverName);
Zapier kept returning Error 400.
I then saw a little further down in the example:
HTTP POST URL Encoded
// Your Domain name with URL path or IP address with path
http.begin(serverName);

Tried it and everything works!
I can’t find any documentation that explains why one form has the reference to the wifi client whereas the other does not. Can you point me to or briefly explain the difference.
Many thanks.

]]>