8

I have a restful webservice with POST method. I want to use this webservice using a GSM Modem with SIM800.

I am using following command instruction:

AT+SAPBR=2,1   --Check if bearer 1 is open or not
AT+SAPBR=1,1   --Enable bearer 1
AT+HTTPINIT
AT+HTTPPARA="URL","myWebserviceURL"
AT+HTTPPARA="CONTENT","application/json"
AT+HTTPDATA=82,10000
  OK
  DOWNLOAD
[mY_dATA_GOES_HERE]
AT+HTTPACTION=1  --POST METHOD
AT+HTTPREAD
So far it works good.

Now I've two parameters in my Headers as in POSTMAN webservice Tool. key=CONTENT-TYPE; value= application/json and key=AuthenticationToken; value=myAutoGeneratedCustomKey. How do I add the second parameter using AT Command?

0

1 Answer 1

5

As per SIM800 AT command Manual, you can set HTTPParamTag to USERDATA and send content in HTTPParamValue. You can pack all key-value pairs into HTTPParamValue and parse to retrieve individual key-value pairs.

A example for SIM 800 HTTP POST with Authentication and signature may be found here as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.