cancel
Showing results for 
Search instead for 
Did you mean: 

Getting HTTP POST to work on SPWF04S

Arta Riazrafat
Associate
Posted on July 12, 2018 at 19:49

Hello, I am trying to get a simple HTTP POST command to work. 

I am using 

http://ptsv2.com

 to host a server. I tested the server using curl command in ubuntu, so I know the issue is not there. What I am doing for HTTP POST:

-> Create a file called 'helloworld.txt' with Hello World! written in it using the AT+S.FSC command (I get the AT-S.OK)

-> Connect to a WIFI network (I get the WIND:24 message)

-> Send the following command : 

   AT+S.HTTPPOST=ptsv2.com/t/testtesttest/post,/helloworld.txt,,,,,,

ptsv2.com/t/testtesttest/post being the hostname for the server and helloworld.txt is just a file in RAM. 

I am getting: 

AT-S.Http Client Error:0

AT-S.ERROR:111:Request failed

I also tried sending config.fhtml instead of helloworld.txt which is a file in the flash, got the same error. 

EDIT: AT-S.Http Client Error:0 is 'Error while resolving Hostname'.  Not sure why the hostname is wrong, I am using the same hostname with linux curl. 

Best Regards, Arta R.

#spwf04s
2 REPLIES 2
Elio Cometti
Senior II
Posted on July 13, 2018 at 09:42

Hello,

following is the correct command syntax (please also compare the

https://www.st.com/resource/en/user_manual/dm00329655.pdf

:(

AT+S.HTTPPOST=ptsv2.com,/t/testtesttest/post,,,,,,helloworld.txt

You'll find my post in your toilet @2018-07-13 07:25:38 UTC.

Best Regards,

Elio

Posted on July 13, 2018 at 16:35

Thank you, it is working.