Thales' cellular IoT products business is now part of Telit Cinterion, find out more.

You are here

Telit Cinterion IoT Developer Community

How to setup several HTTP setting parameters for HTTP requests via AT Internet Service.

Tutorial, March 22, 2016 - 8:59am, 5654 views

EHSx has handy AT Internet service commands, one can easily implement HTTP requests via these commands. 

To properly start a request, one may have to set various HTTP setting parameters, like Content-Type: text/html; charset=ISO-8859-4, via the hcProp.

To use hcProp, one key is multiple settings can be given separated by "\0d\0a" sequences within the string, but do not put "\0d\0a" at the end of setting string.

Here I present a real case that set two parameter for a HTTP POST for reference:

[2016-03-18 10:52:04.0] at^sics=0,conType,none

[2016-03-18 10:52:04.1] OK

[2016-03-18 10:52:13.4] at^siss=0,srvType,none

[2016-03-18 10:52:13.4] OK

[2016-03-18 10:53:25.5] at^sics=0,conType,GPRS0

[2016-03-18 10:53:25.5] OK

[2016-03-18 10:53:43.6] at^sics=0,apn,"internet"

[2016-03-18 10:53:43.6] OK

[2016-03-18 10:54:05.4] at^siss=0,"srvType","http"

[2016-03-18 10:54:05.5] OK

[2016-03-18 10:54:15.2] at^siss=0,"conId",0

[2016-03-18 10:54:15.2] OK

[2016-03-18 10:59:21.2] at^siss=0,"cmd","post"

[2016-03-18 10:59:21.3] OK

[2016-03-18 10:59:47.6] at^siss=0,"hcContent"," "

[2016-03-18 10:59:47.7] OK

[2016-03-18 11:00:06.6] at^siss=0,"hcContLen","2"

[2016-03-18 11:00:06.6] OK

[2016-03-18 11:02:22.0] at^siss=0,"address","http://m2.exosite.com/onep:v1/stack/alias"

[2016-03-18 11:02:22.1] OK

[2016-03-18 11:02:56.4] at^siss=0,"hcProp","X-Exosite-CIK: 8374a8e6224cb26bb9b00adf46884eb9b9546813\0d\0aContent-Type: application/x-www-form-urlencoded; charset=utf-8"

[2016-03-18 11:02:56.5] OK

[2016-03-18 11:03:04.9] at^siso=0

[2016-03-18 11:03:05.0] OK

[2016-03-18 11:03:05.1] ^SIS: 0,0,2200,"Http m2.exosite.com:80"

[2016-03-18 11:03:05.1] ^SISW: 0,1

[2016-03-18 11:03:42.7] at^sisw=0,16,1

[2016-03-18 11:03:42.9] ^SISW: 0,16,0

status=******123

[2016-03-18 11:04:04.8] OK

[2016-03-18 11:04:04.8] ^SISW: 0,2

[2016-03-18 11:04:04.8] ^SIS: 0,0,2200,"HTTP POST: http://m2.exosite.com/onep:v1/stack/alias"

[2016-03-18 11:04:04.8] ^SIS: 0,0,8002,"HttpHTTP POST: IllegalArgumentException HTTP-CODE: 204" 

[2016-03-18 11:04:23.0] at^sisc=0

[2016-03-18 11:04:23.1] OK

[2016-03-18 11:04:31.7] at^siss?

[2016-03-18 11:04:31.8] ^SISS: 0,"srvType","Http"

[2016-03-18 11:04:31.8] ^SISS: 0,"conId","0"

[2016-03-18 11:04:31.8] ^SISS: 0,"address","http://m2.exosite.com/onep:v1/stack/alias"

[2016-03-18 11:04:31.8] ^SISS: 0,"tcpMR","10"

[2016-03-18 11:04:31.8] ^SISS: 0,"tcpOT","6000"

[2016-03-18 11:04:31.8] ^SISS: 0,"cmd","post"

[2016-03-18 11:04:31.8] ^SISS: 0,"hcProp","X-Exosite-CIK: 8374a8e6224cb26bb9b00adf46884eb9b9546813\0d\0aContent-Type: application/x-www-form-urlencoded; charset=utf-8"

[2016-03-18 11:04:31.8] ^SISS: 0,"hcContent"," "

[2016-03-18 11:04:31.8] ^SISS: 0,"hcContLen","2"

[2016-03-18 11:04:31.8] ^SISS: 1,"srvType",""

[2016-03-18 11:04:31.8] ^SISS: 2,"srvType",""

[2016-03-18 11:04:31.8] ^SISS: 3,"srvType",""

[2016-03-18 11:04:31.8] ^SISS: 4,"srvType",""

[2016-03-18 11:04:31.8] ^SISS: 5,"srvType",""

[2016-03-18 11:04:31.8] ^SISS: 6,"srvType",""

[2016-03-18 11:04:31.8] ^SISS: 7,"srvType",""

[2016-03-18 11:04:31.8] ^SISS: 8,"srvType",""

[2016-03-18 11:04:31.8] ^SISS: 9,"srvType",""

[2016-03-18 11:04:31.8] OK

[2016-03-18 11:04:39.2] at^sisc?

The RFC2616 is attached here for reference.

Download File rfc2616.txt (txt | 412.38 KB)

Author

antonyshen's picture
antonyshen