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?

anonymous2
  • 4,902
  • 3
  • 22
  • 49
Rudra
  • 181
  • 4

1 Answers1

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.

sob
  • 2,640
  • 3
  • 19
  • 37