-1

I am using ESP8266 v1 connected to RX & TX pin of my Arduino. I am trying to send AT commands to request post query. But only thing i get is 400 bad request error. I have web api deployed on my PC. The ESP8266 is also connected to the same network. I am able to connect by AT+CIPSTART=1,"TCP","192.168.0.150",8011 . It shows connect ok, then i set the the length of the characters to be sent and i just write the post command but i get 400 error.

below is the steps i am following every command is successful except the post command after > sign.

AT
AT+RST
AT+CWMODE=3
AT+CIPSTART=1,"TCP","192.168.0.150"8011
AT+CIPSEND=1,211

then it shows

>

POST /api/runtime HTTP/1.1\r\n
Host: 192.168.0.150:8011\r\n
Content-Type: application/json\r\n
Content-Length: 37\r\n
Accept: */*\r\n
Connection: Close\r\n
Cache-Control: no-cache\r\n\r\n
{"Value1":22,"Value2":45,"Value3":98}

I am able to send the command from the postman application But not with the AT Command. My address for the API is

http://192.168.0.150:8011/api/RunTime

One more thing i would like to add is am writing these command directly upon the serial monitor with carriage return and new line with baud rate of 115200. I have been scratching my head for a week and found no luck. Please help. Thanks

MY ESP8266 VERSION IS

AT+GMR

AT version:1.3.0.0(Jul 14 2016 18:54:01)
SDK version:2.0.0(5a875ba)
Farylink Technology Co., Ltd. v1.0.0.2
May 11 2017 22:23:58
OK

1 Answers1

0

The request format is okay. what i found is that i used REALTERM software to send the same request and in response i got what i wanted. So if anyone is facing the problem that i was simply verify it by using REALTERM. However one thing that is still bothering me is that i need to press the send button twice to send the request in REALTERM. I believe that this might be due to the Length defined in

AT+CIPSEND=1,{CONTENTLENGTHINNUMBER}

i hope this help someone.