Page 1 of 1

Sending POST and GET request with params and body

Posted: Sun Oct 27, 2019 11:32 am
by travjav
Hello,

I am new to the ESP* module and am super excited to get this thing working.I have successfully been able to communicate with the module using my Arduino serial port. This particular module is going to be controlled by my Embedded device ( stm32**) in which I need to send AT commands to the module to communicate with my backend that I have running.

I am un-clear and unsuccessful getting this going in the context of HTTP requests; here is what I need to do

NOTE: because I cannot share my complete url due to privacy I will use something with the same length ********connected.com:443

1. Send login information to ********connected.com/login (POST) body{"email":"myemail.ca", "password":"xxxxx"}
- once I get the token I will make other requests.

2. get information regarding user profile ********connected.com/getRoutine ( GET) query param username="bob"

3. I really want to understand how these requests are structured so if someone can explain it to me elegantly that would be great!


Here is what I have tried..

AT > OK

AT+CIPSTART="TCP","********connected.com",443 > CONNECT OK

AT+CIPSEND=48 >
"GET ********connected.com:443/getUsersOnline"
OK
>
Recv 48 bytes

SEND OK
CLOSED

Re: Sending POST and GET request with params and body

Posted: Wed Oct 30, 2019 11:46 am
by Her Mary

Re: Sending POST and GET request with params and body

Posted: Sun Nov 10, 2019 12:49 pm
by travjav
@Her Mary

This helped, but it was a GET request. My request will be a post and I have been unable to find any solid good explanations on how to prepare these properly. With my examples included in the question; I cannot get my server to respond to the ESP client in any situation. I have been blocked on this for more than a few weeks now :?