Skip to main content
Dmytro Medvid
Associate II
January 9, 2018
Question

SPWF04 HTTP POST Problem

  • January 9, 2018
  • 1 reply
  • 1351 views
Posted on January 09, 2018 at 14:30

Hello, everybody.

I want to use HTTP client mode. I should send the next message: 

api/Tokens?username=test&password=123456789&serialnumber=123456789

to the server:

https://messagebus.example.com

and get the response. 

I try to make next:

AT+S.HTTPPOST=messagebus.example.com,/api/Tokens,,,,,Get.txt,Send.txt

In send file i have 

username=

test

&password=

123456789

&serialnumber=

123456789

but, server give me Error 404 answer. I think, there is a problem in my AT+S.HTTPOST mesage.

    This topic has been closed for replies.

    1 reply

    Gerardo GALLUCCI
    ST Employee
    January 9, 2018
    Posted on January 09, 2018 at 16:48

    Probably I'm using wrong URL...

    I get 'DNS error' (502 Bad Gateway) with the browser, and 'Http Client Error:0' with the module. Is it correct 'messagebus.example.com'?

    Dmytro Medvid
    Associate II
    January 9, 2018
    Posted on January 09, 2018 at 19:28

    No, it is just for example.

    Gerardo GALLUCCI
    ST Employee
    January 10, 2018
    Posted on January 10, 2018 at 11:28

    Don't know how to help you...

    Try to bypass the send.txt file, and directly put form content into <path&query> parameter. Same result?

    AT+S.HTTPPOST=messagebus.example.com,/api/Tokens?

    username=test&password=123456789&serialnumber=123456789

    ,,,,,,