Beruflich Dokumente
Kultur Dokumente
AT Commands Manual
Rev. GSM_HTTP_AT_Commands_Manual_V1.4
Date: 2017-11-13
Status: Released
www.quectel.com
GSM/GPRS Module Series
GSM HTTP AT Commands Manual
Our aim is to provide customers with timely and comprehensive service. For any
assistance, please contact our company headquarters:
GENERAL NOTES
QUECTEL OFFERS THE INFORMATION AS A SERVICE TO ITS CUSTOMERS. THE INFORMATION
PROVIDED IS BASED UPON CUSTOMERS’ REQUIREMENTS. QUECTEL MAKES EVERY EFFORT
TO ENSURE THE QUALITY OF THE INFORMATION IT MAKES AVAILABLE. QUECTEL DOES NOT
MAKE ANY WARRANTY AS TO THE INFORMATION CONTAINED HEREIN, AND DOES NOT ACCEPT
ANY LIABILITY FOR ANY INJURY, LOSS OR DAMAGE OF ANY KIND INCURRED BY USE OF OR
RELIANCE UPON THE INFORMATION. ALL INFORMATION SUPPLIED HEREIN IS SUBJECT TO
CHANGE WITHOUT PRIOR NOTICE.
COPYRIGHT
THE INFORMATION CONTAINED HERE IS PROPRIETARY TECHNICAL INFORMATION OF
QUECTEL WIRELESS SOLUTIONS CO., LTD. TRANSMITTING, REPRODUCTION, DISSEMINATION
AND EDITING OF THIS DOCUMENT AS WELL AS UTILIZATION OF THE CONTENT ARE
FORBIDDEN WITHOUT PERMISSION. OFFENDERS WILL BE HELD LIABLE FOR PAYMENT OF
DAMAGES. ALL RIGHTS ARE RESERVED IN THE EVENT OF A PATENT GRANT OR
REGISTRATION OF A UTILITY MODEL OR DESIGN.
Copyright © Quectel Wireless Solutions Co., Ltd. 2017. All rights reserved.
GSM_HTTP_AT_Commands_Manual 1 / 16
GSM/GPRS Module Series
GSM HTTP AT Commands Manual
History
GSM_HTTP_AT_Commands_Manual 2 / 16
GSM/GPRS Module Series
GSM HTTP AT Commands Manual
Contents
1 Introduction ....................................................................................................................................... 4
1.1. AT Command Syntax ............................................................................................................ 4
3 Examples ......................................................................................................................................... 10
3.1. Send GET Request to HTTP Server ................................................................................... 10
3.2. Send POST Request to HTTP Server ..................................................................................11
3.3. Download a File From HTTP Server ................................................................................... 12
3.4. Customize HTTP Header and Show HTTP Response Header ........................................... 12
GSM_HTTP_AT_Commands_Manual 3 / 16
GSM/GPRS Module Series
GSM HTTP AT Commands Manual
1 Introduction
Quectel module provides an internal TCP/IP stack that is driven by AT commands and enables the host
application to easily access the Internet services which include TCP service, UDP service, FTP service
and HTTP service, etc. This document is a reference guide to all the AT commands and responses
defined for HTTP service. The advantage of this solution is that it eliminates the need for the application
manufacturer to implement own HTTP protocol, thus minimizing cost and time to integrate Internet
connectivity into a new or existing host application.
Write Command AT+<x>=<…> This command sets the user-definable parameter values.
GSM_HTTP_AT_Commands_Manual 4 / 16
GSM/GPRS Module Series
GSM HTTP AT Commands Manual
OK
Write Command Response
AT+QHTTPURL=<url_len>[,<input_ti CONNECT
me>]
If there is an error related to ME functionality:
ERROR
+CME ERROR: <err>
Parameter
<url_len> Numeric type. The length of URL. The range is 1-2048. Unit: byte.
<input_time> Numeric type. The maximum time for inputting URL. The range is 1-65535, and the
default value is 120. Unit: second.
<err> Integer type. The error code of the operation. Please refer to Chapter 4.
OK
Write Command Response
GSM_HTTP_AT_Commands_Manual 5 / 16
GSM/GPRS Module Series
GSM HTTP AT Commands Manual
AT+QHTTPGET=<to_read_time>[,<wa OK
it_time>[,<data_size>]]
If there is an error related to ME functionality:
ERROR
+CME ERROR: <err>
Parameter
<to_read_time> The maximum timeout waiting for reading data from server after sending HTTP
GET request to server successfully. AT+QHTTPREAD will be invalid if idle time
after AT+QHTTPGET is longer than the time of <to_read_time>. The range is
1-65535, and the default value is 120. Unit: second.
<wait_time> The time waiting for data from server after sending HTTP GET request to server
successfully. If there is no data coming from server within timeout value, an error
will be returned. The range is 15-65535, and the default value is 120. Unit:
second.
<data_size> Integer type. Indicates the data bytes to download from HTTP server. The range is
0-102400, and the default value is 0.
<err> Integer type. The error code of the operation. Please refer to Chapter 4.
OK
Write Command Response
AT+QHTTPPOST=<body_size>[,<inpu CONNECT
t_time>[,<to_read_time>]] <data>
OK
GSM_HTTP_AT_Commands_Manual 6 / 16
GSM/GPRS Module Series
GSM HTTP AT Commands Manual
Parameter
<body_size> Size of the post body. The range is 1-29696. Unit: byte.
<input_time> Maximum time for inputting the data. The range is 1-65535, and the default value is
120.
<to_read_time> The maximum timeout waiting for reading data from server after sending HTTP POST
request to server successfully. AT+QHTTPREAD will be invalid if the idle time after
AT+QHTTPGET is longer than the time of <to_read_time>. The range is 1-65535,
and the default value is 120. Unit: second.
<data> The POST data to input from UART.
<err> Integer type. The error code of the operation. Please refer to Chapter 4.
OK
Write Command Response
AT+QHTTPREAD=<wait_time> CONNECT
<data>
OK
Parameter
<wait_time> The maximum waiting time for reading response from HTTP Server. HTTP session will
be closed when timeout. The range is 1-65535, and the default value is 120. Unit:
second.
<data> The data of HTTP server responds.
<err> Integer type. The error code of the operation. Please refer to Chapter 4.
GSM_HTTP_AT_Commands_Manual 7 / 16
GSM/GPRS Module Series
GSM HTTP AT Commands Manual
OK
Write Command Response
AT+QHTTPDL=“<filename>”[,<length OK
>[,<wait_time>]]
Finally, if the file is downloaded successfully, response:
+QHTTPDL: <dl size>,<content-length>,<errcode>
Parameter
OK
GSM_HTTP_AT_Commands_Manual 8 / 16
GSM/GPRS Module Series
GSM HTTP AT Commands Manual
OK
Write Command Response
AT+QHTTPCFG="responseheader"[,< If <responseheader> is not omitted, response:
responseheader>] OK
or
+CME ERROR: <errorcode>
OK
Reference
Parameter
<requestheader> Numeric type. It indicates if customizing HTTP request header is allowed or not.
0 Disable the customization HTTP request header
1 Enable the customization HTTP request header
<responseheader> Numeric type. It indicates if outputting HTTP response header is allowed or not
0 Disable the output of HTTP response header
1 Enable the output of HTTP response header
<errorcode> Integer type. The error code of the operation. Please refer to Chapter 4.
GSM_HTTP_AT_Commands_Manual 9 / 16
GSM/GPRS Module Series
GSM HTTP AT Commands Manual
3 Examples
GSM_HTTP_AT_Commands_Manual 10 / 16
GSM/GPRS Module Series
GSM HTTP AT Commands Manual
AT+QIREGAPP //Optional
OK
AT+QIACT //Optional
OK
OK
//POST the data whose size is 18 bytes and the maximum latency time for inputting is 50s.
//It is recommended to set the latency time as long as enough to download all the data in the latency time.
AT+QHTTPPOST=18,50,10
CONNECT
//This means module enters into data mode and is ready to receive data from UART.
//For example, input 18 bytes: Message=helloworld.
OK
//This means all data has been received, and DCD is set to high.
CONNECT
<Output data> //Output the response data of HTTP server to UART.
//For example, UART outputs:
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="https://api.efxnow.com/webservices2.3">Message='helloworld' ASCII:104 101 108 108
111 119 111 114 108 100 </string>
OK
AT+QIDEACT //Deactivate PDP context.
DEACT OK
GSM_HTTP_AT_Commands_Manual 11 / 16
GSM/GPRS Module Series
GSM HTTP AT Commands Manual
OK
AT+QHTTPDL="RAM:1.TXT",1024
//Download the file to RAM:1.TXT, and the maximum size of the file is 1024 bytes.
+QHTTPDL: 1024,102400,401
OK
OK
AT+QHTTPCFG ="responseheader",1
OK
AT+QHTTPURL=58
CONNECT
//Input URL "http://api.efxnow.com/DEMOWebServices2.8/Service.asmx/Echo".
OK
GSM_HTTP_AT_Commands_Manual 12 / 16
GSM/GPRS Module Series
GSM HTTP AT Commands Manual
AT+QHTTPPOST=229
CONNECT
//Input customers’ own header like below:
POST /DEMOWebServices2.8/Service.asmx/Echo HTTP/1.1
Host: api.efxnow.com
Accept: */*
User-Agent: QUECTEL_MODULE
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 18
Message=helloworld
OK
AT+QHTTPREAD=30
CONNECT
//The data returned from server is as below:
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Sat, 17 Aug 2013 05:06:23 GMT
Content-Length: 170
GSM_HTTP_AT_Commands_Manual 13 / 16
GSM/GPRS Module Series
GSM HTTP AT Commands Manual
<err> Meaning
GSM_HTTP_AT_Commands_Manual 14 / 16
GSM/GPRS Module Series
GSM HTTP AT Commands Manual
GSM_HTTP_AT_Commands_Manual 15 / 16
GSM/GPRS Module Series
GSM HTTP AT Commands Manual
4008 No space
4009 Timeout
GSM_HTTP_AT_Commands_Manual 16 / 16