HTTP命令

AM900E HTTP AT指令


1.  AT+HTTPINIT

  

HTTP初始化服务

执行命令

AT+HTTPINIT

  

OK/ERROR

测试命令

AT+HTTPINIT=?

  

+HTTPINIT

 

OK

 

  注:执行此命令前需首先执行AT+CGACT=1,1

 

2. AT+HTTPPARA

  

设置HTTP命令参数

设置命令

AT+HTTPPARA=<HTTPParamTag>,<HTTPParamValue>

  

OK/ERROR

测试命令

AT+HTTPPARA=?

 

+HTTPPARA:<tag>,<value>

 

OK

 

 

 

参数说明

<HTTPParamTag> Name of HTTP parameter. parameter list:

“CID” (Mandatory Parameter) Bearer profile identifier

“URL” (Mandatory Parameter) HTTP client URL: “http://’server’/’path’:’tcpPort’”. “server”: FQDN or IPaddress, “path”: path of file or directory, “tcpPort”: default value is 80. Refer to “IETF-RFC 2616”.

<HTTPParamValue> HTTP Parameter value.Type and supported content depend on related <HTTPParamTag>.

 

  注:Before this command is executed, it is necessary to process AT+HTTPINIT

 

3 . AT+HTTPDATA

  

输入HTTP数据

执行命令

AT+HTTPDATA

响应“>”,输入数据,执行 CTRL+Z 来发送

  

OK/ERROR

测试命令

AT+HTTPDATA=

 

+HTTPDATA

 

OK

 

 

4 . AT+HTTPACTION

  用

执行HTTP请求

执行命令

AT+HTTPACTION=<method_code>

  回

OK

 

<method_code>,<status_code>,<content_length>

测试命令

AT+HTTPACTION=?

 

+HTTPACTION=(0~5)

 

OK

参数说明

<method_code>:HTTP methods. 0 GET 1 POST 2 HEAD 3 DELETE 4 DELETE(for onenet) 5 PUT(for onenet)

 

<status_code>: HTTP Status Code responded by remote server, it identifier refer to HTTP1.1(RFC2616) 100 Continue

101 Switching Protocols

200 OK

201 Created

202 Accepted

203 Non-Authoritative Information....

 

 5.  AT+HTTPREAD

  用

读取HTTP服务器回应信息

执行命令

AT+HTTPREAD=<start_address>,<byte_size>

  回

OK/ERROR

测试命令

AT+HTTPREAD=?

  回

+HTTPREAD:<OFFSET>,<MEMSIZE>

 

OK

参数说明

<start_address> :The starting point for data output. 0-319488 (bytes)

<byte_size> :The length for data output.1-319488 (bytes)

 

 6.  AT+HTTPTERM

  用

终止HTTP连接

执行命令

AT+HTTPTERM

  回

OK/ERROR

测试命令

AT+HTTPTERM=?

  回

OK/ERROR