AT+CIPSEND multiple POST request body [ESP01][ESP8266]

Arduino Uno >[SoftwareSerial]> ESP01

I am programing Arduino to send AT command to a web hosting server.

What will work:


> POST /echo.php HTTP/1.0
Content-Length: 20

this is POST payload

Server respond:

+IPD,854:HTTP/1.1 200 OK
Date: Fri, 30 Mar 2018 20:41:13 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Server: awex
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Request-ID: 446bb0a824a3ca74638c65cc641cee1d

<!DOCTYPE html>

this is POST payload


  • newline above is \r\n
  • I put the whole HTTP request in single String variable

Now, I want to send “body” of the post request separately. Meaning that there will be two AT+CIPSEND. This is to save more RAM space and I can put the “body” String in other non-volatile memory space. I plan to send multiple binary file too . Which will be:


> POST /echo.php HTTP/1.0
Content-Length: 20


>this is POST payload

Sever side “echo.php” will echo back the HTTP content if it received the post request. However, the server doesen’t like this and do not echo what I’ve sent:

$entityBody = file_get_contents('php://input');

I have a feeling that the problem might have to do with my HTTP formatting. Can someone help?