-1

How to read JSON object response from the server?

These are the commands I use:

AT+SAPBR=3,1,"Contype","GPRS"
AT+SAPBR=3,1,"APN","internet"
AT+SAPBR=1,1
AT+SAPBR=2,1
AT+HTTPINIT
AT+HTTPSSL=1
AT+HTTPPARA="CID",1
AT+HTTPPARA="URL","https://www.mywebsite.com/getTime?token=jsdaljdaskl"
AT+HTTPPARA="REDIR",1
AT+HTTPACTION=0

The returning request should be Json object, but the Sim808 read it as html response which gives error 606.

Alvin Stefanus
  • 1,873
  • 2
  • 22
  • 60
  • Write some code, and come back when you have issues with the code. Alternatively, visit https://arduino.stackexchange.com/ for advice. This site is for coding questions. – dda Jul 29 '17 at 09:25

1 Answers1

2

Need to define HTTP parameter content as JSON format using the following command

AT+HTTPPARA="CONTENT","application/json"

Found this document useful HTTP Client using SIM900.

Ganesh K
  • 36
  • 2