Quectel EC20 AT Commands Manual V1.0

Quectel_EC20__AT_Commands_Manual_V1.0

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 32

DownloadQuectel EC20  AT Commands Manual V1.0
Open PDF In BrowserView PDF
EC20 HTTP
AT Commands Manual
LTE Module Series
Rev. EC20_HTTP_AT_Commands_Manual_V1.0
Date: 2015-07-02

www.quectel.com

LTE Module Series
EC20 HTTP AT Commands Manual

Our aim is to provide customers with timely and comprehensive service. For any
assistance, please contact our company headquarters:
Quectel Wireless Solutions Co., Ltd.
Office 501, Building 13, No.99, Tianzhou Road, Shanghai, China, 200233
Tel: +86 21 5108 6236
Mail: info@quectel.com

Or our local office, for more information, please visit:

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

http://www.quectel.com/support/salesupport.aspx

For technical support, to report documentation errors, please visit:
http://www.quectel.com/support/techsupport.aspx
Or Email: Support@quectel.com

GENERAL NOTES

QUECTEL OFFERS THIS 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

THIS INFORMATION CONTAINED HERE IS PROPRIETARY TECHNICAL INFORMATION OF
QUECTEL CO., LTD. TRANSMITTABLE, REPRODUCTION, DISSEMINATION AND EDITING OF THIS
DOCUMENT AS WELL AS UTILIZATION OF THIS CONTENTS 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. 2015. All rights reserved.

EC20_HTTP_AT_Commands_Manual

Confidential / Released

1 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

About the Document
History
Revision
1.0

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Date

Author

Description

2015-07-02

Chris PENG

Initial

EC20_HTTP_AT_Commands_Manual

Confidential / Released

2 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

Contents
About the Document ................................................................................................................................... 2
Contents ....................................................................................................................................................... 3
Table Index ................................................................................................................................................... 4
1

Introduction .......................................................................................................................................... 5
1.1.
The Process of Using HTTP AT Commands ............................................................................. 5
1.2.
Description of HTTP Header ..................................................................................................... 6
1.2.1. Customize HTTP Request Header .................................................................................. 6
1.2.2. Output HTTP Response Header ...................................................................................... 6
1.3.
Description of Data Mode ........................................................................................................ 6
1.4.
Error Handling ......................................................................................................................... 7
1.4.1. Executing HTTP AT Command Fails ............................................................................... 7
1.4.2. PDP Activation Fails ......................................................................................................... 7
1.4.3. DNS Parse Fails ............................................................................................................... 8
1.4.4. Entering Online Data Mode Fails ..................................................................................... 8
1.4.5. Sending GET/POST Request Fails.................................................................................. 8
1.4.6. Reading Response Fails .................................................................................................. 9

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

2

Description of AT Command ............................................................................................................ 10
2.1.
AT+QHTTPCFG Configure Parameters for HTTP(S) Server ............................................... 10
2.2.
AT+QHTTPURL Set HTTP(S) Server URL .......................................................................... 12
2.3.
AT+QHTTPGET Send GET Request to HTTP(S) Server .................................................... 13
2.4.
AT+QHTTPPOST Send POST Request to HTTP(S) Server by UART/USB ....................... 14
2.5.
AT+QHTTPPOSTFILE Send POST Request to HTTP(S) Server by File ............................ 16
2.6.
AT+QHTTPREAD Read Response from HTTP(S) Server by UART/USB ........................... 18
2.7.
AT+QHTTPREADFILE Read Response from HTTP(S) Server by File ............................... 18

3

Example .............................................................................................................................................. 20
3.1.
Access to HTTP Server ........................................................................................................... 20
3.1.1. Send HTTP GET Request.............................................................................................. 20
3.1.2. Send HTTP POST Request ........................................................................................... 21
3.1.2.1. Post Body Obtained from UART/USB .................................................................. 21
3.1.2.2. Post Body Obtained from File System ................................................................. 22
3.2.
Access to HTTPS Server......................................................................................................... 23
3.2.1. Send HTTP GET Request.............................................................................................. 23
3.2.2. Send HTTP POST Request ........................................................................................... 25
3.2.2.1. Post Body Obtained from UART/USB .................................................................. 25
3.2.2.2. Post Body Obtained from File System ................................................................. 26

4
5
6

Summary of ERROR Code ................................................................................................................ 28
Summary of HTTP Response Code ................................................................................................. 30
Appendix A Reference....................................................................................................................... 31

EC20_HTTP_AT_Commands_Manual

Confidential / Released

3 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

Table Index
TABLE 1: DIFFERENT CODING SCHEMES OF +CME ERROR :  ...................................................... 28
TABLE 2: DIFFERENT CODING SCHEMES OF HTTP RESPONSE CODE ................................................... 30
TABLE 3: RELATED DOCUMENTS .................................................................................................................. 31
TABLE 4: TERMS AND ABBREVIATIONS ........................................................................................................ 31

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
EC20_HTTP_AT_Commands_Manual

Confidential / Released

4 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

1

Introduction

EC20 provides HTTP application to HTTP(S) server. This document is a reference guide to all the AT
commands defined for HTTP.

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

1.1. The Process of Using HTTP AT Commands

Through EC20 TCPIP AT command, you can configure PDP context, activate and deactivate PDP context,
query PDP context status (Please refer to Quectel_EC20_TCPIP_AT_Commands_Manual), and through
EC20 HTTP AT command, you can send HTTP GET/POST request to HTTP server, and read HTTP
response from HTTP server. The general process is as follows:
Step 1: Configure the , ,  and other parameters of PDP context by
AT+QICSGP (Please refer to Quectel_EC20_TCPIP_AT_Commands_Manual). If QoS settings
need to be updated, configure them by the commands AT+CGQMIN, AT+CGEQMIN,
AT+CGQREQ and AT+CGEQREQ (For more details, please refer to Quectel_EC20_AT_
Commands_Manual).
Step 2: Activate PDP context by AT+QIACT, then the assigned IP address can be queried by
AT+QIACT? (Please refer to Quectel_EC20_TCPIP_AT_Commands_Manual).
Step 3: Set PDP context ID and SSL context ID by AT+QHTTPCFG command.
Step 4: Configure SSL context parameters by AT+QSSLCFG
Quectel_EC20_SSL_AT_Commands_Manual).

command

(Please

refer

to

Step 5: Set HTTP URL by AT+QHTTPURL command.

Step 6: Send HTTP request. AT+QHTTPGET command can be used for sending HTTP GET request,
AT+QHTTPPOST or QHTTPOSTFILE command can be used for sending HTTP POST
request.
Step 7: Read HTTP response information by AT+QHTTPREAD or QHTTPREADFILE command.

Step 8: Deactivate PDP context by AT+QIDEACT command. (For details, please refer to
Quectel_EC20_TCPIP_AT_Commands_Manual).

EC20_HTTP_AT_Commands_Manual

Confidential / Released

5 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

1.2. Description of HTTP Header
1.2.1. Customize HTTP Request Header
HTTP request header is filled by the modem automatically. If you want to customize the HTTP request
header, you can set  as 1 by AT+QHTTPCFG command, and then input HTTP request
header as below:
1.
2.
3.

Follow HTTP header syntax.
The value of URI in HTTP request line and the “Host:” header must be in line with the URL configured
by AT+QHTTPURL command.
The HTTP request header must end with .

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

The following example shows a valid HTTP POST request header:
POST/processorder.php HTTP/1.1
Host: 220.180.239.201:8011
Accept: */*
User-Agent: QUECTEL_MODULE
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 42


1.2.2. Output HTTP Response Header

HTTP response header will not output automatically. If you want to obtain HTTP response header
information, you can set  to 1 by AT+QHTTPCFG command, and the HTTP response
header will be output with HTTP response body when you execute AT+QHTTPREAD or
AT+QHTTPREADFILE command.

1.3. Description of Data Mode

The mode of the COM port includes AT command mode and data mode. The difference between them is
as follows:
1)
2)

In AT command mode, the data input via COM port will be treated as AT command.
In data mode, the data input via COM port will be treated as data.

EC20_HTTP_AT_Commands_Manual

Confidential / Released

6 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

You can exit from data mode by using “+++” or pulling up DTR (AT&D1 should be set).To prevent the
“+++” from being misinterpreted as data, it should comply with the following sequence:
1)
2)
3)

Do not input any character within 1 second before inputting “+++”.
Input “+++” within 1 second, and no other characters can be input during this time.
Do not input any character wit in 1 second after “+++” has been input.

When you execute QHTTPURL, QHTTPHEAD, QHTTPOST and QHTTPREAD, the modem will enter
data mode. If you are using “+++” or DTR to make module exit from online data mode, the executing
procedure of these command will be interrupted before the executed result is returned, and you can’t
reenter online data mode by executing ATO command.

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

1.4. Error Handling

1.4.1. Executing HTTP AT Command Fails

If you execute HTTP AT command and receive response “ERROR” from modem, please check whether
the SIM card is inserted and the result of “AT+CPIN?” is “+CPIN: READY”.

1.4.2. PDP Activation Fails

If you failed to active PDP context by AT+QIACT command, please check the following aspects:
1.

Query whether the PS domain is attached by AT+CGATT? command. If not, execute AT+CGATT=1
command to attach PS domain.
2. Query the PS domain status by AT+CGREG? command and make sure the PS domain has been
registered.
3. Query the PDP context parameters by AT+QICSGP command and make sure the APN of specified
PDP context has been set.
4. Make sure the specified PDP context ID is neither used by PPP nor activated by AT+CGACT
command.
5 The module only supports three PDP contexts activated simultaneously, so you must make sure the
amount of activated PDP context is less than 3.
If the result of above checking is OK, but the executing of AT+QIACT command still fails, please reboot
the modem to resolve this issue. After rebooting the modem, please follow the above checking at least
three times and each time at an interval of 10 minutes to avoid frequent rebooting of the module.

EC20_HTTP_AT_Commands_Manual

Confidential / Released

7 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

1.4.3. DNS Parse Fails
When executing AT+QHTTPGET, AT+QHTTPPOST and QHTTPPOSTFILE commands, if “+CME
ERROR: 714” (714: HTTP DNS error) is returned, please check the following aspects:
1. Make sure the domain name of HTTP server is valid.
2. Query the status of PDP context via AT+QIACT? command to make sure the specified PDP context
has been activated successfully.
3. Query the address of DNS server via AT+QIDNSCFG command to make sure the address of DNS
server is not equal to “0.0.0.0”.

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

If the DNS server address is equal to “0.0.0.0”, there are two solutions:
1.
2.

Reassign a valid DNS server address by AT+QIDNSCFG command.
Deactivate the PDP context by AT+QIDEACT command, and re-activate the PDP context via
AT+QIACT command.

1.4.4. Entering Online Data Mode Fails

When executing QHTTPURL, QHTTPGET, QHTTPPOST and QHTTPREAD commands, if “+CME
ERROR: 704” (704: HTTP UART busy) is returned, please check whether there are other ports in online
data mode, since the modem only supports one port in online data mode simultaneously.
If you encounter this issue during executing QHTTPURL, QHTTPGET, QHTTPPOST and QHTTPREAD
command, please re-execute these commands after other ports exit from online data mode.

1.4.5. Sending GET/POST Request Fails

If you receive a failed result during executing AT+QHTTPGET, AT+QHTTPPOST and QHTTPPOSTFILE
command, please check the following aspects:
1. Make sure the URL input via HTTPURL command is valid and can be accessed.
2. Make sure the specified server supports GET/POST command.
3. Make sure the PDP context has been activated successfully.

If the result of above checking is OK, but the executing of AT+QHTTPGET, QHTTPPOST and
QHTTPPOSTFILE command still fails, please deactivate the PDP context via AT+QIDEACT and
reactivate the PDP context via AT+QIACT to resolve this issue. If you encounter failed result during
activating the PDP context, please refer to Chapter 1.4.2 to resolve it.

EC20_HTTP_AT_Commands_Manual

Confidential / Released

8 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

1.4.6. Reading Response Fails
Before reading response by AT+QHTTPREAD and QHTTPREADFILE command, you should execute
AT+QHTTPGET, AT+QHTTPPOST and QHTTPPOSTFILE command and receive the URC information:
“+QHTTPGET: [,[,]]”/
“+QHTTPPOST: [,[,]]”/
“+QHTTPPOSTFILE: [,,]”
During executing AT+QHTTTPREAD and QHTTPREADFILE command, if you encounter some errors,
such as: “+CME ERROR: 717” (717: HTTP read error), please resend HTTP GET/POST request to HTTP
server by AT+QHTTPGET, AT+QHTTPPOST and QHTTPPOSTFILE command. If you encounter failed
result during sending GET/POST request to HTTP server, please refer to Chapter 1.4.5 to resolve it.

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

EC20_HTTP_AT_Commands_Manual

Confidential / Released

9 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

2

Description of AT Command

2.1. AT+QHTTPCFG

Configure Parameters for HTTP(S) Server

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

AT+QHTTPCFG is used to configure the parameters for HTTP service, including PDP context ID,
customizing HTTP request header and outputting HTTP response header and querying SSL settings. If
the write command only executes one parameter, it will query the current settings.

AT+QHTTPCFG

Configure Parameters for HTTP(s) Server

Test Command
AT+QHTTPCFG=?

Response
+QHTTPCFG: “contextid”,(1-16)
+QHTTPCFG: “requestheader”,(0,1)
+QHTTPCFG: “responseheader”,(0,1)
+QHTTPCFG: “sslctxid”,(0-5)
+QHTTPCFG: "contenttype",(0-3)
OK

Write Command
AT+QHTTPCFG=“contextid”[,]

Response
If  is not omitted:
OK
or
+CME ERROR: 

Else, query the current settings:
+QHTTPCFG: “contextid”,
OK

Write Command
AT+QHTTPCFG=“requestheader”[,]

Response
If  is not omitted:
OK
or
+CME ERROR: 

Else, query the current settings:
+QHTTPCFG: “requestheader”,
OK

EC20_HTTP_AT_Commands_Manual

Confidential / Released

10 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

Write Command
AT+QHTTPCFG=“responseheader”[,]

Response
If  is not omitted:
OK
or
+CME ERROR: 
Else, query the current settings:
+QHTTPCFG: “responseheader”,
OK

Write Command
AT+QHTTPCFG=“sslctxid”[,
]

Response
If  is not omitted:
OK
or
+CME ERROR: 

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Else, query the current settings:
+QHTTPCFG: “sslctxid”,
OK

Read Command
AT+QHTTPCFG?

Parameter










Response
+QHTTPCFG: “contextid”,
+QHTTPCFG: “requestheader”,
+QHTTPCFG: “responseheader”,
+QHTTPCFG: “sslctxid”,
+QHTTPCFG: "contenttype",
OK

Numeric type, indicates PDP context ID, range is 1-16, default value is 1
Numeric type, indicates whether to customize HTTP request header
0
Disable
1
Enable
Numeric type, indicates whether to output HTTP response header or not
0
Disable
1
Enable
Numeric type, indicates this SSL context ID will be used for HTTP. The range
is 0-5, default value is 1. You should configure the SSL parameter by
AT+QSSLCFG. (For details, please refer to the command AT+QSSLCFG in
Quectel_EC20_SSL_AT_Commands_Manual.)
Numeric type, indicates the data type of HTTP body
0 application/x-www-form-urlencoded

EC20_HTTP_AT_Commands_Manual

Confidential / Released

11 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

1
text/plain
2
application/octet-stream
3
multipart/form-data
The type of error, please refer to Chapter 4



2.2. AT+QHTTPURL Set HTTP(S) Server URL
To input URL, you must begin with “http://” or “https://”. If the URL begins with “http://”, it indicates you will
access to a HTTP server. If the URL begins with “https://”, it indicates you will access to a HTTPS server.

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

AT+QHTTPURL Set HTTP(S) Server URL
Test Command
AT+QHTTPURL=?

Response
+QHTTPURL: (1-700),(1-65535)
OK

Write Command
AT+QHTTPURL=[,]

Response
a) If format is right, and it is not sending HTTP GET/POST
request at present:
CONNECT
TA switches to the transparent access mode, and the URL can
be input. When the total size of the input data reaches
, TA will return to command mode and report
the following codes:
OK

If the  has reached, but the received length of URL
is less than , TA will return to command mode
and report the following code:
+CME ERROR: 
b) If parameter format is not right or other errors occur:
+CME ERROR: 

Read Command
AT+QHTTPURL?

Response
[+QHTTPURL: ]
OK

Parameter



Numeric type, indicates the length of URL, range is 1-700, unit: byte
Numeric type, indicates the maximum time in seconds to input URL, range is

EC20_HTTP_AT_Commands_Manual

Confidential / Released

12 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

1-65535, default value is 60, unit: second
The type of error, please refer to Chapter 4



2.3. AT+QHTTPGET Send GET Request to HTTP(S) Server
According
to
the
configured
parameter

in
the
command
AT+QHTTPCFG=“requestheader”[,], the HTTPGET write command has two different
formats, the details are shown as below. Please note that if  equals to 1, after the
command AT+QHTTPGET has been sent, the CONNECT may be output in 125s to indicate that the
connection is successful. If it is not received during this time, the +CME ERROR:  will be output.

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

After the HTTPGET write command has been sent, it is suggested to wait a specific time (refer to the
Maximum Response Time below) after the result code OK is reported for the URC response
“+QHTTPGET: [,[,]]”.

In the URC “+QHTTPGET: [,[,]]”, the parameter  can
only be reported when  equals to 0. If HTTP response header contains “CONTENT-LENGTH”
information, the  information will be reported.

AT+QHTTPGET Send GET Request to HTTP(S) Server
Test Command
AT+QHTTPGET=?

Response
+QHTTPGET: (1-65535),(1-2048),(1-65535)
OK

If  equals to 0
(disable customizing HTTP request
header)
AT+QHTTPGET[=]

Response
a) If parameter format is right and no other errors occur:
OK

When modem has received response from HTTP server, it will
report the following URC:
+QHTTPGET: [,[,]]
b) If parameter format is not right or other errors occur:
+CME ERROR: 

If  equals to 1 (enable
customizing HTTP request header)
AT+QHTTPGET=,[,]

Response
a) If connect HTTP server successfully:
CONNECT

TA switches to the transparent access mode, and the HTTP
GET request header can be input. When the total size of the
input data reaches , TA will return to command
mode and report the following codes:

EC20_HTTP_AT_Commands_Manual

Confidential / Released

13 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

OK
When modem has received response from HTTP server, it will
report the following URC:
+QHTTPGET: [,[,]]
If the  has reached, but the length of received
data is less than , TA will return to command
mode and report the following code:
+CME ERROR: 

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
b) If parameter format is not right or other errors occur:
+CME ERROR: 
Determined by 

Maximum Response Time

Parameter










Numeric type, the range is 1-65535. The default value is 60, unit: second. It is
used to configure the timeout for the HTTP GET response URC “+QHTTPGET:
[,,]” to report after the result code OK is
returned
Numeric type, indicates the length of HTTP request information, including HTTP
request header and HTTP request body, range is 1-2048, unit: byte
Numeric type, indicates the maximum time in seconds to input HTTP request
information, range is 1-65535. The default value is 60, unit: second
Please refer to Chapter 4
Please refer to Chapter 5
Please refer to Chapter 2.1
Numeric type, indicates the length of HTTP response body, unit: byte.

2.4. AT+QHTTPPOST

Send POST Request to HTTP(S) Server by

UART/USB

You can send HTTP POST request via AT+QHTTPPOST command. According to the configured
parameter  in the command AT+QHTTPCFG=“requestheader”[,],
the HTTPPOST write command has two different formats, if you set  to 0, you should
input post body by UART/USB, else if you set  to 1, you should input post header and
body by UART/USB.

EC20_HTTP_AT_Commands_Manual

Confidential / Released

14 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

After the command AT+QHTTPPOST has been sent, the CONNECT may be output in 125s to indicate
the connection is successful, if it isn’t received during this time, the +CME ERROR:  will be output.
It is suggested to wait a specific time (refer to the Maximum Response Time below) after the result code
OK is reported for the URC response “+QHTTPPOST: [,[,]]”.

AT+QHTTPPOST Send POST Request to HTTP(S) Server by UART/USB
Test Command
AT+QHTTPPOST=?

Response
+QHTTPPOST: (1-1024000),(1-65535),(1-65535)
OK

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

If  equals to 0
(disable customizing HTTP request
header)
AT+QHTTPPOST=[,,]

Response
a) If parameter format is right and HTTP server is connected
successfully and HTTP request header is sent completely, it
will prompt you to input body:
CONNECT

TA switches to the transparent access mode, and the HTTP
POST body can be input. When the total size of the input data
reaches , TA will return to command mode and
report the following codes:
OK
When modem has received response from HTTP server, it will
report the following URC:
+QHTTPPOST: [,[,]]

If the  has reached, but the received length of
data is less than , TA will return to command
mode and report the following code:
+CME ERROR: 
b) If parameter format is not right or other errors occur:
+CME ERROR: 

If  equals to 1 (enable
customizing HTTP request header)
AT+QHTTPPOST=[,,]

Response
a) If parameter format is right and HTTP server is connected
successfully:
CONNECT

TA switches to the transparent access mode, and the HTTP
POST header and body can be input. When the total size of
the input data reaches , TA will return to
command mode and report the following codes:
OK

EC20_HTTP_AT_Commands_Manual

Confidential / Released

15 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

When modem has received response from HTTP server, it will
report the following URC:
+QHTTPPOST: [,[,]]
If the  has reached, but the length of received
data is less than , TA will return to command
mode and report the following code:
+CME ERROR: 
b) If parameter format is not right or other errors occur:
+CME ERROR: 

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

Maximum Response Time

Parameter











Determined by network and 

Numeric type, if  is 0, it indicates the length of post body,
and if  is 1, it indicates the length of HTTP request
information, including HTTP request header and HTTP request body, range is
1-1024000, unit: byte
Numeric type, indicates the maximum time in seconds to input post body or
HTTP request information, range is 1-65535. The default value is 60, unit:
second
Numeric type, range is 1-65535. The default value is 60, unit: second. It is
used to configure the timeout for the HTTP POST response URC
“+QHTTPPOST: [,[,]]” to report after the
result code OK is returned
Please refer to Chapter 4
Please refer to Chapter 5
Please refer to Chapter 2.1
Numeric type, indicates the length of HTTP response body, unit: byte

2.5. AT+QHTTPPOSTFILE Send POST Request to HTTP(S) Server by
File

You also can send HTTP POST request in file via AT+QHTTPPOSTFILE command. According to the
 in the command AT+QHTTPCFG=“requestheader”[,], the file
operated through HTTPPOSTFILE command has two different formats, if set  to 0, the
file in file system will be post body, else if set  to 1, the file in file system will be post
header and body.

EC20_HTTP_AT_Commands_Manual

Confidential / Released

16 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

The modem will report information “+QHTTPPOSTFILE: [,[,]]” to
indicate the executing result of AT+QHTTPPOSFILE command. The parameter  can only
be reported when  equals to 0.
It is suggested to wait a specific time (refer to the Maximum Response Time below) after the result code
OK is reported for the URC response “+QHTTPPOSTFILE: [,[,]]”.

AT+QHTTPPOSTFILE

Send POST Request to HTTP(S) Server by File

Test Command
AT+QHTTPPOSTFILE=?

Response
+QHTTPPOSTFILE: ,(1-65535)

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
OK

Write Command
AT+QHTTPPOSTFILE=[,<
rsptime>]

If  equals to 1, the
specified file must contain HTTP
request header information.

Response
a) If parameter format is right and HTTP server is connected
successfully:
OK
When modem has received response from HTTP server, it will
report the following URC:
+QHTTPPOSTFILE:
[,,]
b) If parameter format is not right or other errors occur:
+CME ERROR: 
Determined by 

Maximum Response Time

Parameter








String type, file name, the max length of file name is 80, unit: byte
Numeric type, the range is 1-65535. The default value is 60, unit: second. It
is used to configure the timeout for the HTTP POST response URC
“+QHTTPPOSTFILE: [,,]” to report
after the result code OK is returned.
Please refer to Chapter 4
Please refer to Chapter 5
Please refer to Chapter 2.1
Numeric type, indicates the length of HTTP response body

EC20_HTTP_AT_Commands_Manual

Confidential / Released

17 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

2.6. AT+QHTTPREAD

Read Response from HTTP(S) Server by

UART/USB
After sending HTTP GET/POST request, you can retrieve HTTP response information from HTTP server
to UART/USB via AT+QHTTPREAD command. And before executing AT+QHTTPREAD, “+QHTTPGET:
[,[,]]”, “+QHTTPPOST: [,[,]]” or
“+QHTTPPOSTFILE: [,,]” information must be received.

AT+QHTTPREAD Read Response from HTTP(S) Server by UART/USB

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

Test Command
AT+QHTTPREAD=?

Response
+QHTTPREAD: (1-65535)
OK

Write Command
AT+QHTTPREAD[=]

Response
a) If parameter format is right and read successfully:
CONNECT

OK
+QHTTPREAD: 

If  reaches or other errors occur, but body has not
output completely, it will report the following codes:
+CME ERROR: 
b) If parameter format is not right or other errors occur:
+CME ERROR: 

Parameter



Numeric type, indicates the maximum interval time between receiving two packets
of data. The default value is 60, unit: second
Please refer to Chapter 4

2.7. AT+QHTTPREADFILE

Read Response from HTTP(S) Server by File

After sending HTTP GET/POST request, you can retrieve HTTP response information from HTTP server
to file via AT+QHTTPREADFILE command. And before executing AT+QHTTPREADFILE, “+QHTTPGET:
[,[,]]”, “+QHTTPPOST: [,[,]]” or

EC20_HTTP_AT_Commands_Manual

Confidential / Released

18 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

“+QHTTPPOSTFILE: [,,]” information must be received.

AT+QHTTPREADFILE Read Response from HTTP(S) Server by File
Test Command
AT+QHTTPREADFILE=?

Response
+QHTTPREADFILE: ,(1-65535)
OK

Write Command
AT+QHTTPREADFILE=[,
]

Response
a) If parameter format is right:
OK

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
When body is read over or  reaches, it will report:
+QHTTPREADFILE: 
b) If parameter format is not right or other errors occur:
+CME ERROR: 

Parameter




Numeric type, indicates the maximum interval time between receiving two
packets of data, range is 1-65535. The default value is 60, unit: second
String type, file name, the max length of file name is 80, unit: byte.
Please refer to Chapter 4

EC20_HTTP_AT_Commands_Manual

Confidential / Released

19 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

3

Example

3.1. Access to HTTP Server

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

3.1.1. Send HTTP GET Request

Following example shows how to send HTTP GET request with a customer HTTP request header, and
how to read HTTP GET response.
//How to send HTTP GET response.

AT+QHTTPCFG=“contextid”,1
OK
AT+QHTTPCFG=“responseheader”,1
OK
AT+QIACT?
OK
AT+QICSGP=1,1,“UNINET”,“”,“”,1
OK
AT+QIACT=1
OK
AT+QIACT?
+QIACT: 1,1,1,"10.7.157.1"
OK
AT+QHTTPURL=23,80
CONNECT
HTTP://www.sina.com.cn/
OK
AT+QHTTPGET=80
OK

+QHTTPGET: 0,200,547256

//Set the PDP context ID as 1.

//Allow to output HTTP response header.

//Query the state of context.

//Configure context 1, APN is “UNINET” for China Unicom.

//Activate context 1.
//Activate successfully.
//Query the state of context.

//Set the URL which will be accessed.

//Input URL which length is 23, note that this URL is an example,
please input the correct URL in practical test.

//Send HTTP GET request and maximum response time is 80s.

//If HTTP response header contains “CONTENT-LENGTH”
information, the  information will be reported.

//How to read HTTP response.
//Solution 1: Read HTTP response information and output by UART

EC20_HTTP_AT_Commands_Manual

Confidential / Released

20 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

AT+QHTTPREAD=80

//Read HTTP response information and output by UART, the
maximum time to wait for HTTP session to close is 80s.

CONNECT
HTTP/1.1 200 OK 
//HTTP response header and body.
Content-Type: text/html
Vary: Accept-Encoding
X-Powered-By: shci_v1.03
Server: nginx
Date: Fri, 27 Dec 2013 02:21:43 GMT
Last-Modified: Fri, 27 Dec 2013 02:20:01 GMT
Expires: Fri, 27 Dec 2013 02:22:43 GMT
Cache-Control: max-age=60
Age: 1
Content-Length: 547256
X-Cache: HIT from xd33-85.sina.com.cn


OK

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

+QHTTPREAD: 0

//Read HTTP response header and body successfully.

//Solution 2: Read HTTP response information and store it to RAM file.
AT+QHTTPREADFILE=“RAM:1.txt”,80

OK

+QHTTPREADFILE: 0

//Read HTTP response header and body and store them to
“RAM:1.txt”, the maximum time to wait for HTTP session to
close is 80s.

//HTTP response header and body are stored successfully.

3.1.2. Send HTTP POST Request

3.1.2.1. Post Body Obtained from UART/USB

Following example shows how to send HTTP POST request and retrieve post body from UART/USB. In
addition, it also shows how to read HTTP POST response.
AT+QHTTPCFG=“contextid”,1
OK
AT+QIACT?
OK
AT+QICSGP=1,1,“UNINET”,“”,“”,1
OK
AT+QIACT=1

EC20_HTTP_AT_Commands_Manual

//Set the PDP context ID as 1.

//Query the state of context.
//Configure context 1, APN is “UNINET” for China Unicom.
//Activate context 1.

Confidential / Released

21 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

OK
AT+QIACT?
+QIACT: 1,1,1,"172.22.86.226"

//Activate successfully.
//Query the state of context.

OK
AT+QHTTPURL=59,80
//Set the URL which will be accessed.
CONNECT
HTTP://api.efxnow.com/DEMOWebServices2.8/Service.asmx/Echo? //Input URL which length is 59,
note that this URL is an
example, please input the
correct URL in practical test.
OK
AT+QHTTPPOST=20,80,80
//Send HTTP POST request, POST body is obtained from UART,
maximum input body time is 80s and maximum response time is
80s.
CONNECT
Message=HelloQuectel
//Input post body which length is 20, note that post body is an
example, please input the correct post body in practical test.
OK

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

+QHTTPPOST: 0,200,177
AT+QHTTPREAD=80

//If HTTP response header contains “CONTENT-LENGTH”
information, the  information will be reported.
//Read HTTP response body and output by UART, the maximum
time to wait for HTTP session to close is 80s.

CONNECT

Message='HelloQuectel' ASCII:72
101 108 108 111 81 117 101 99 116 101 108  //Output HTTP response body.
OK
+QHTTPREAD: 0

//HTTP response body is output successfully.

3.1.2.2. Post Body Obtained from File System

Following example shows how to send HTTP POST request and retrieve post body from file system. In
addition, it also shows how to store HTTP POST response to file system.
AT+QHTTPCFG=“contextid”,1
OK
AT+QIACT?
OK
AT+QICSGP=1,1,“UNINET”,“”,“”,1
OK
AT+QIACT=1

EC20_HTTP_AT_Commands_Manual

//Set the PDP context ID as 1.
//Query the state of context.
//Configure context 1, APN is “UNINET” for China Unicom.
//Activate context 1.

Confidential / Released

22 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

OK
AT+QIACT?
+QIACT: 1,1,1,"172.22.86.226"

//Activate successfully.
//Query the state of context.

OK
AT+QHTTPURL=59,80
//Set the URL which will be accessed.
CONNECT
HTTP://api.efxnow.com/DEMOWebServices2.8/Service.asmx/Echo? //Input URL which length is 59,
note that this URL is an
example, please input the
correct URL in practical test.
OK
AT+QHTTPPOSTFILE=“RAM:2.txt”,80 //Send HTTP POST request, POST body is obtained from
“RAM:2.txt”, and maximum response time is 80s.
OK

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

+QHTTPPOSTFILE: 0,200,177

AT+QHTTPREADFILE=“RAM:3.txt”,80
OK

+QHTTPREADFILE: 0

//After HTTP POST request is sent success, you can execute
command AT+QHTTPREAD.
//Read HTTP response body and store it to “RAM:3.txt”, the
maximum time to wait for HTTP session to close is 80s.

//HTTP response body is stored successfully.

3.2. Access to HTTPS Server
3.2.1. Send HTTP GET Request

Following example shows how to send HTTP GET request with a customer HTTP request header, and
how to read HTTP GET response.
//How to send HTTP GET request.

AT+QHTTPCFG=“contextid”,1
OK
AT+QHTTPCFG=“responseheader”,1
OK
AT+QIACT?
OK
AT+QICSGP=1,1,“UNINET”,“”,“”,1
OK
AT+QIACT=1
OK

EC20_HTTP_AT_Commands_Manual

//Set the PDP context ID as 1.

//Allow to output HTTP response header.
//Query the state of context.

//Configure context 1, APN is “UNINET” for China Unicom.
//Activate context 1.
//Activate successfully.

Confidential / Released

23 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

AT+QIACT?
+QIACT: 1,1,1,"10.7.157.1"

//Query the state of context.

OK
AT+QHTTPCFG=“sslctxid”,1
//Set the SSL context ID.
OK
AT+QSSLCFG=“sslversion”,1,1
//Set the SSL version as 1, it means TLsV1.0.
OK
AT+QSSLCFG=“ciphersuite”,1,0x0005 //Set the SSL ciphersuite as 0x0005, it means RC4-SHA.
OK
AT+QSSLCFG=“seclevel”,1,0
//Set the SSL verify level as 0, it means you don’t need any CA
Cert.
OK
AT+QHTTPURL=19,80
//Set the URL which will be accessed.
CONNECT
HTTPs://mail.qq.com/
//Input URL which length is 19, note that this URL is an example,
please input the correct URL in practical test.
OK
AT+QHTTPGET=80
//Send HTTP GET request and maximum response time is 80s.
OK

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

+QHTTPGET: 0,200,10750

//If HTTP response header contains “CONTENT-LENGTH”
information, the  information will be
reported.

//How to read HTTP response.

//Solution 1: Read HTTP response information and output by UART.
AT+QHTTPREAD=80

//Read HTTP response information and output by UART,
the maximum time to wait for HTTP session to close is 80s.
//HTTP response header and body.

CONNECT
HTTP/1.1 200 OK
Server: nginx/1.2.7
Date: Fri, 27 Dec 2013 02:38:27 GMT
Content-Type: text/html; charset=GB18030
Content-Length: 10750
Connection: keep-alive


OK
+QHTTPREAD: 0

//Read HTTP response header and body successfully.

//Solution 2: Read HTTP response information and store it to RAM file.

EC20_HTTP_AT_Commands_Manual

Confidential / Released

24 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

AT+QHTTPREADFILE=“RAM:4.txt”,80 //Read HTTP response header and body and store it to
“RAM:4.txt”, the maximum time to wait for HTTP session to
close is 80s.
OK
+QHTTPREADFILE: 0

//HTTP response header and body are stored successfully.

3.2.2. Send HTTP POST Request
3.2.2.1. Post Body Obtained from UART/USB

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

Following example shows how to send HTTP POST request and retrieve post body from UART/USB. In
addition, it also shows how to read HTTP POST response.
AT+QHTTPCFG=“contextid”,1
OK
AT+QIACT?
OK
AT+QICSGP=1,1,“UNINET”,“”,“”,1
OK
AT+QIACT=1
OK
AT+QIACT?
+QIACT: 1,1,1,"172.22.86.226"

//Set the PDP context ID as 1.

//Query the state of context.

//Configure context 1, APN is “UNINET” for China Unicom.

//Activate context profile 1.
//Activate successfully.
//Query the state of context.

OK
AT+QHTTPCFG=“sslctxid”,1
//Set the SSL context ID.
OK
AT+QSSLCFG=“sslversion”,1,1
//Set the SSL Version as 1, it means TLsV1.0.
OK
AT+QSSLCFG=“ciphersuite”,1,0x0005 //Set the SSL ciphersuite as 0x0005, it means RC4-SHA.
OK
AT+QSSLCFG=“seclevel”,1,2
//Set the SSL verify level as 2, it means you should upload CA
Cert, client Cert and client private key by AT+QFUPL command.
OK
AT+QSSLCFG=“cacert”,1, “RAM:cacert.pem”
OK
AT+QSSLCFG=“clientcert”,1,“RAM:clientcert.pem”
OK
AT+QSSLCFG=“clientkey”,1,“RAM:clientkey.pem”
OK
AT+QHTTPURL=45,80
//Set the URL which will be accessed.
CONNECT

EC20_HTTP_AT_Commands_Manual

Confidential / Released

25 / 31

LTE Module Series
EC20 HTTP AT Commands Manual

HTTPs://220.180.239.201:8011/processorder.php

OK
AT+QHTTPPOST=48,80,80

//Input URL which length is 45, note that URL is an
example, please input the correct URL in
practical test.

//Send HTTP POST request , POST body is obtained from UART,
maximum input body time is 80s and maximum response time is
80s.

CONNECT
Message=1111&Appleqty=2222&Orangeqty=3333&find=1

OK

//Input post body which length is 48, note
that this post body is an example, please
input the correct one in practical test.

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
//If HTTP response header contains “CONTENT-LENGTH”
information, the  information will be reported.
//Read HTTP response body and output by UART, the maximum
time to wait for HTTP session to close is 80s.
//Read HTTP response body successfully.

+QHTTPPOST: 0,200,285
AT+QHTTPREAD=80

CONNECT


Quectel's Auto Parts - Order Results


Quectel's Auto Parts

Order Results

Order processed at 02:49, 27th December

Your order is as follows:

1111 message
2222 apple
3333 orange
OK +QHTTPREAD: 0 //HTTP response body is output successfully. 3.2.2.2. Post Body Obtained from File System Following example shows how to send HTTP POST request and retrieve post body from file system. In addition, it also shows how to store HTTP POST response to file system. AT+QHTTPCFG=“contextid”,1 OK AT+QIACT? OK EC20_HTTP_AT_Commands_Manual //Set the PDP context ID as 1. //Query the state of context. Confidential / Released 26 / 31 LTE Module Series EC20 HTTP AT Commands Manual AT+QICSGP=1,1,“UNINET”,“”,“”,1 OK AT+QIACT=1 OK AT+QIACT? +QIACT: 1,1,1,"172.22.86.226" //Configure context 1, APN is “UNINET” for China Unicom. //Activate context 1. //Activate successfully. //Query the state of context. OK AT+QHTTPCFG=“sslctxid”,1 //Set the SSL context ID. OK AT+QSSLCFG=“sslversion”,1,1 //Set the SSL version as 1, it means TLsV1.0. OK AT+QSSLCFG=“ciphersuite”,1,0x0005 //Set the SSL ciphersuite as 0x0005, it means RC4-SHA. OK AT+QSSLCFG=“seclevel”,1,2 //Set the SSL verify level as 2, it means you should upload CA Cert, client Cert and client private key by AT+QFUPL command. OK AT+QSSLCFG=“cacert”,1,“RAM:cacert.pem” OK AT+QSSLCFG=“clientcert”,1,“RAM:clientcert.pem” OK AT+QSSLCFG=“clientkey”,1,“RAM:clientkey.pem” OK AT+QHTTPURL=45,80 //Set the URL which will be accessed. CONNECT HTTPs:// 220.180.239.201:8011/processorder.php //Input URL which length is 45, note that this URL is an example, please input the correct URL in practical test. OK AT+QHTTPPOSTFILE=“RAM:5.txt”,80 //Send HTTP POST request, POST body is obtained from “RAM:5.txt”, and maximum response time is 80s. OK l e t l c a e i t u n Q ide f n o C +QHTTPPOSTFILE: 0,200,285 //After HTTP POST request success, you can execute command AT+QHTTPREAD. AT+QHTTPREADFILE=“RAM:6.txt”,80 //Read HTTP response body and store it to “RAM:6.txt”, the maximum time to wait for HTTP session to close is 80s. OK +QHTTPREADFILE: 0 EC20_HTTP_AT_Commands_Manual //HTTP response body is stored successfully. Confidential / Released 27 / 31 LTE Module Series EC20 HTTP AT Commands Manual 4 Summary of ERROR Code Table 1: Different Coding Schemes of +CME ERROR : 0 701 702 703 704 705 706 707 708 709 710 711 712 713 Meaning l e t l c a e i t u n Q ide f n o C Operation successful HTTP unknown error HTTP timeout HTTP busy HTTP UART busy HTTP no get/post request HTTP network busy HTTP network open fail HTTP network no config HTTP network deactivated HTTP network error HTTP URL error HTTP empty URL HTTP IP address error 714 HTTP DNS error 715 HTTP socket create error 716 HTTP socket connect error 717 HTTP socket read error EC20_HTTP_AT_Commands_Manual Confidential / Released 28 / 31 LTE Module Series EC20 HTTP AT Commands Manual 718 HTTP socket write error 719 HTTP socket close 720 HTTP data encode error 721 HTTP data decode error 722 HTTP read timeout 723 HTTP response fail 724 725 726 727 728 729 730 l e t l c a e i t u n Q ide f n o C Incoming call busy Voice call busy Input timeout Wait data timeout Wait HTTP response timeout Alloc memory fail Invalid parameter EC20_HTTP_AT_Commands_Manual Confidential / Released 29 / 31 LTE Module Series EC20 HTTP AT Commands Manual 5 Summary of HTTP Response Code Table 2: Different Coding Schemes of HTTP Response Code 200 403 404 409 411 500 Meaning l e t l c a e i t u n Q ide f n o C OK Forbidden Not found Conflict Length required Internal Server error EC20_HTTP_AT_Commands_Manual Confidential / Released 30 / 31 LTE Module Series EC20 HTTP AT Commands Manual 6 Appendix A Reference Table 3: Related Documents SN Document Name Remark [1] RFC2616 Hyper Text Transport Protocol [2] Quectel_EC20_TCPIP_AT_Commands_Manual Introduction about EC20 TCPIP AT commands [3] Quectel_EC20_FILE_AT_Commands_Manual Introduction about EC20 FILE AT commands [4] Quectel_EC20_AT_Commands_Manual EC20 AT commands manual [5] Quectel_EC20_SSL_AT_Commands_Manual Introduction about EC20 SSL AT commands l e t l c a e i t u n Q ide f n o C Table 4: Terms and Abbreviations Abbreviation HTTP SSL DTR PPP DNS Description Hyper Text Transport Protocol Security Socket Layer Data Terminal Ready Point-to-Point Protocol Domain Name Server URL Uniform Resource Locator URI Uniform Resource Identifier EC20_HTTP_AT_Commands_Manual Confidential / Released 31 / 31

Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.5
Linearized                      : No
Has XFA                         : No
Language                        : zh-CN
XMP Toolkit                     : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:08:04
Format                          : application/pdf
Creator                         : kelly
Create Date                     : 2015:07:02 16:12:42+08:00
Creator Tool                    : Microsoft® Word 2010
Modify Date                     : 2015:07:02 16:20:06+08:00
Metadata Date                   : 2015:07:02 16:20:06+08:00
Producer                        : Microsoft® Word 2010
Document ID                     : uuid:b6a8ce22-9a85-46a8-b1cc-9bc4fe377367
Instance ID                     : uuid:f84509d8-071c-400f-ae98-89e40983862f
Page Mode                       : UseOutlines
Page Count                      : 32
Author                          : kelly
EXIF Metadata provided by EXIF.tools

Navigation menu