Sending POST and GET request with params and body
Posted: Sun Oct 27, 2019 11:32 am
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
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