HTTPS GET and POST request

Suraj123
Posts: 1
Joined: Sun May 25, 2025 7:23 am

HTTPS GET and POST request

Postby Suraj123 » Sun May 25, 2025 7:47 am

Hi team,

Am currently working on ESP32 HTTPS GET and POST request, am using ESP32C3 module with latest AT firmware loaded in it, am using below AT command to get some JSON response from cloud
AT+HTTPCLIENT=3,1, .... POST command, the issue comes here as below am getting response in chunks of 2times, lets say

+HTTPCLIENT:136,{"success":true,"message":"Gateway wifi Info fetched Successfully","data":{"gateway_ids":["123004","123005"],"ip_addresses":["x.x.x.x
+HTTPCLIENT:100,0.166","x.x.x."],"connected_cnt":[7,1],"wifi_networks":"ESP32","wifi_passwords":"test@1"}}

OK

Why am getting response in 2 chunks, where could be the issue ?
1) What are the possible ways to get response in single chunks, do i need to configure any headers before sending command, if yes can you please share the set of commands
2) How many bytes can ESP32C3 send as response in single chunk for AT+HTTPCLIENT request ? Is there any other commands preferably more used for HTTPs GET and POST request for AT FIRMWARE support? could you suggest other than above command
3) what is the difference between AT+HTTPCPOST and AT+HTTPCLIENT, when to use it accordingly ?

esp-at
Espressif staff
Espressif staff
Posts: 335
Joined: Mon May 09, 2022 3:00 am

Re: HTTPS GET and POST request

Postby esp-at » Mon May 26, 2025 3:07 am

This is possible. The server's reply is probably sent to the ESP module twice at the TCP layer. In this way, the module's HTTP will receive it twice.
1) are you sure you're using the latest v3.3.0.0 firmware for ESP32-C3?
2) If the server does send TCP in two parts, I don't think there is an effective way to make the server send it only once on the client, because this is the behavior of TCP under the HTTP server. But generally speaking, the MTU of Ethernet is 1500, which means that only when the content of the HTTP server reply exceeds ~1300 bytes (MTU - http_header_len - tcp_header_len - ip_header_len) will it be divided into multiple packets and sent multiple times. It is not so reasonable to divide it into several hundred bytes.
3) You can try the AT+HTTPCGET command and AT+HTTPCPOST command. If need add more http headers, you can use AT+HTTPCHEAD command.
4) In generally, it is more recommended to use AT+HTTPCGET and AT+HTTPCPOST command. which can support to set http buffer size, and set more http headers.

Who is online

Users browsing this forum: No registered users and 1 guest