2018-03-14 11:44 PM
Hello and good day!
I'm attempting to use the SPWF01SA module with an STM32F0 microcontroller to post some data onto a remote web server.
I have come to understand that the
AT+S.HTTPPOST
command can only post form data. However, my requirement is to post a JSON packet instead of form data. So, I'm using theAT+S.HTTPREQ
command to send a custom POST request. However, the problem I'm facing is that I'm receiving only '\r' as response from theSPWF01SA module, on executing the
AT+S.HTTPREQ
command.
To walk through my steps, I'm first connecting to a WiFi network using all relevant commands, and am able to successfully receive the 'WIND:24' message from the module. After this, I'm sending the
AT+S.HTTPREQ
command to the module in the following format:
AT+S.HTTPREQ=
https://community.st.com/external-link.jspa?url=https%3A%2F%2Fwww.xxxx.com%2C80%2C1000%5Cr
POST /gaiahardsurveytest/v2/getHardSurveyData HTTPS/1.1\r\n
Host: SPWF01SA\r\n
Content-Type: application/json\r\n
Content-Length: 700\r\n
{JSON_PACKET}\r\n\r\n
I would like to make a special mention that I need to POST data to an HTTPS server, however, I've tried posting over HTTP as well, and have faced the same issue of not getting any reply from the SPWF01SA module beyond a '\r' which the module sends back instantly.
Please guide me, and tell me if I'm missing any steps or making any errors.
Thank you,
Archit#spwf01sa #wifi #spwf01sSolved! Go to Solution.
2018-03-31 06:30 PM
The DataLen is very important.
Make sure the number of bytes sent is the same as the number you put in the request.
2018-03-31 06:30 PM
The DataLen is very important.
Make sure the number of bytes sent is the same as the number you put in the request.