As of now I'm mostly interested in POST requests, there are no examples on github, but I was able to modify https example and successfully sent POST message to external server (created a data record on a server), but got a problem: ESP32 doesn't process a response from the server, it just freezes and no log messages fired. And if I comment the part of the code, which processes the response, no issues appeared. Can somebody help with this or just provide a correct example how to send POST requests?
This is my POST request:
Code: Select all
POST https://xxxx.xxxx.com/xx/xxxxx HTTP/1.1
Host: xxxx.xxxx.com
Accept: application/json
Content-Type: application/json
Authorization: Basic aW90LxxxxxaW90LmRhdGE3MDc=
Cache-Control: no-cache
Content-Length: 30
{"u_payload": "ping from iot"}
I was not able to correctly modify http code example to send POST request - ESP32 log says socket send success, but there is errno=128 and no information comes to the external server. Any ideas on how to deal with that?
Code: Select all
I (7605) IoT data: ... socket send success
I (10805) IoT data: ... done reading from socket. Last read return=0 errno=128