Hey guy Im trying to send AT cmd to a ESP8266, to connected to a API from school and then return the content.
I managede to get the ESP to connect to a AP (in this case my phone).
And I can get a TCP connection with the API (DNS not working, so using the IP instead).
But i want to get the data of the website.
When you go there you just get a HTML page with Json information. I want to get that JSON information.
I also read this post, but I unclear if i need to send the \r\n too.
IP of the website: 145.92.228.31
For testing Im using putty to send the info
AT+CIPSEND=4,57
GET /crypto/ADA HTTP/1.1\r\n Host: www.api.iot.hva-robots.nl\r\n\r\n
Are these 57 bytes too? or am I sending this wrong?
It will work since you specified the length in the CIPSEND command. The ESP8266 will accept the \r\n literally until you send the total bytes specified
As Juraj specified, typing \r\n in Putty does not result in \r\n being sent as it is interpreted literally by Putty. That is equivalent to 4 characters instead of the desired 2.
I don't think its possible to "type" \r\n in Putty and send that as a newline and carriage return. You need a different terminal program. You can try CoolTerm
It has something to do with using HTTP in general. You can't avoid it unless you want to use raw TCP and then you'll have total control of the bytes sent and received