5

I am reposting a question here from my StackOverflow

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?

  • 1
    Welcome @Rudra — cross-posting isn't encouraged on Stack Exchange; it would make sense for you to delete your copy on Stack Overflow since this question has an answer here. Thanks. – Aurora0001 Apr 10 '18 at 11:13
3

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.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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