Skip to main content
Arta Riazrafat
Associate
July 12, 2018
Question

Getting HTTP POST to work on SPWF04S

  • July 12, 2018
  • 1 reply
  • 951 views
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
    This topic has been closed for replies.

    1 reply

    Elio Cometti
    Visitor II
    July 13, 2018
    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

    Arta Riazrafat
    Associate
    July 13, 2018
    Posted on July 13, 2018 at 16:35

    Thank you, it is working.