You are on page 1of 2

HTTP (Hypertext Transfer Protocol)

To use HTTP function using SIM900 modem follow below AT commands. Two methods are
there namely,

GET: to get data from server.

POST: to post data to server.

First, we need to connect to GPRS by configure bearer profile using AT command as,

Demonstration Syntax ExpectedResponse

AT+SAPBR=3,1,"Contype","GPRS" OK

Configure bearer profile 1

AT+SAPBR=3,1,"APN","internet" OK

To open a GPRS context. AT+SAPBR =1,1 OK

+SAPBR: 1,1,"10.89.193.1"
AT+SAPBR=2,1
OK

To close a GPRS context. AT+SAPBR =0,1 OK

Note: Enter Access Point Name (APN) of corresponding network service provider. E.g. here
we have entered “internet” which is APN of IDEA network.

Now let’s see AT commands for GET method,

HTTP GET method

Demonstration Syntax ExpectedResponse

Initiate http service AT+HTTPINIT OK

AT+HTTPPARA= “CID”,1
OK
Set parameters for HTTP
session
AT+HTTPPARA=
OK
“URL”,”api.thingspeak.com”

GET session start AT+HTTPACTION=0 OK

GET successfully AT+SAPBR =0,1 +HTTPACTION:0,200,1000


+HTTPREAD: 1000
Read the data of HTTP
AT+HTTPREAD Read data….
server
OK

Terminate http service AT+HTTPTERM OK

Note: Enter http client URL. e.g. here we have entered “api.thingspeak.com”.

Now let’s see AT commands for POST method,

HTTP POST method

Demonstration Syntax Expected Response

Initiate http service AT+HTTPINIT OK

AT+HTTPPARA= “CID”,1 OK

Set parameters for HTTP session AT+HTTPPARA= “URL”,”


www.google.com” OK

DOWNLOAD
POST the data whose size is 100Bytes
and the maximum latency time for Enter data of exact size
inputting is 10000ms. It is mentioned in syntax
AT+HTTPDATA=100,10000
recommended to set the latency time OK
long enough to download all the Data
in the latency time. All data has been
received

POST session start AT+HTTPACTION=1 OK

POST successfully +HTTPACTION:1,200,0

Terminate http service AT+HTTPTERM OK

You might also like