2

I am trying to send a simple GET/POST request to a dummy end point on https://requestbin.com/. I am using an ESP8266 module. I am using the arduino serial monitor to send these AT commands. I connect to wifi and then use the following AT commands

AT+CIPSTART="TCP","54.166.71.140 ",443  (the IP address from requestbin)

I then do

AT+CIPSEND=80

followed by

GET / HTTP/1.0\r\nHost: fc35001f8ec49962d182320446070d.m.pipedream.net\r\n\r\n

I get the output as follows

Recv 80 bytes

SEND OK

+IPD,272:HTTP/1.1 400 Bad Request
Server: awselb/2.0
Date: Mon, 07 Dec 2020 13:28:01 GMT
Content-Type: text/html
Content-Length: 122
Connection: close

<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
</body>
</html>
CLOSED

Is there problem with the length of CIPSEND or the format of the request itself.

8
  • the \r\n are send as \r\n, not as new line characters Commented Dec 7, 2020 at 14:45
  • how should the At command look like in that case ? Commented Dec 7, 2020 at 14:47
  • send first GET / HTTP/1.0, then Host: fc35001f8ec49962d182320446070d.m.pipedream.net and then an empty line. do it fast before the connection times out Commented Dec 7, 2020 at 14:53
  • what would be the value for CIPSEND in this case ? Commented Dec 7, 2020 at 14:56
  • the count should include the new line charcaters. \r as 1 and \n as 1 character Commented Dec 7, 2020 at 14:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.