AT command for HTTP functions
HTTP support is not defined in the 3GPP AT command specification. However many module vendors provide proprietary HTTP AT commands. Many IT applications developers are very familiar with developing HTTP applications based on PHP or .net framework. So it is an added benefit if the module supports a native HTTP stack.
SIM900 GPRS module supports HTTP AT commands. They are fairly easy to use. Before HTTP connection can be established, a GPRS data call (PDP Context) should be set up before.
With Online AT Command Tester tool, it is easy to test HTTP with the SIMCOM modules. The tool provides the interfaces to read/add/edit/delete bearer profiles which contain information about the typr connection used for HTTP (GPRS or Circuit Switch). Then users can test HTTP GET and HTTP POST functions with their own URLs.
Initiate the HTTP service,
AT+HTTPINIT
OK
Set the HTTP session.
AT+HTTPPARA=”CID”,1
OK
Set the HTPP URL
at+httppara=”URL”,”www.m2msupport.net/m2msupport/test.php”
Start the session
AT+HTTPACTION=0
OK
+HTTPACTION:0,601,0
The above AT response code (601) for HTTP session start indicates that there is a network error. Then make sure that the PDP context is setup properly.
IF the HTTP session is sucessful, it should return code of ‘200’,
AT+HTTPACTION=0
OK
+HTTPACTION:0,200,4
Above HTTP GET request is sucessful and it returned 4 bytes.
To read the data of the HTTP server,
AT+HTTPREAD
+HTTPREAD:4
test
OK
To terminate the HTTP service,
AT+HTTPTERM
OK