Sending POST and GET request with params and body

travjav
Posts: 4
Joined: Sat Oct 19, 2019 12:14 am

Sending POST and GET request with params and body

Postby travjav » 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

Her Mary
Posts: 401
Joined: Mon Oct 27, 2014 11:09 am

Re: Sending POST and GET request with params and body

Postby Her Mary » Wed Oct 30, 2019 11:46 am


travjav
Posts: 4
Joined: Sat Oct 19, 2019 12:14 am

Re: Sending POST and GET request with params and body

Postby travjav » Sun Nov 10, 2019 12:49 pm

@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 :?

Who is online

Users browsing this forum: Google [Bot] and 5 guests