0% found this document useful (0 votes)
10 views37 pages

Quectel bg96 Https Application Note v1-1

The BG96 HTTP(S) Application Note provides a comprehensive guide on using HTTP(S) AT commands for the BG96 module, detailing the process of configuring a PDP context, sending requests, and reading responses. It includes legal notices, privacy policies, and disclaimers regarding the use of the document and associated materials. The document also outlines command syntax, error handling, and examples for effective implementation of HTTP(S) functionalities.

Uploaded by

undelaharshitha1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views37 pages

Quectel bg96 Https Application Note v1-1

The BG96 HTTP(S) Application Note provides a comprehensive guide on using HTTP(S) AT commands for the BG96 module, detailing the process of configuring a PDP context, sending requests, and reading responses. It includes legal notices, privacy policies, and disclaimers regarding the use of the document and associated materials. The document also outlines command syntax, error handling, and examples for effective implementation of HTTP(S) functionalities.

Uploaded by

undelaharshitha1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

BG96 HTTP(S)

Application Note

LPWA Module Series

Version: 1.1

Date: 2025-01-02

Status: Released
LPWA Module Series

At Quectel, our aim is to provide timely and comprehensive services to our customers. If you
require any assistance, please contact our headquarters:

Quectel Wireless Solutions Co., Ltd.


Building 5, Shanghai Business Park Phase III (Area B), No.1016 Tianlin Road, Minhang District, Shanghai
200233, China
Tel: +86 21 5108 6236
Email: info@[Link]

Or our local offices. For more information, please visit:


[Link]

For technical support, or to report documentation errors, please visit:


[Link]
Or email us at: support@[Link].

Legal Notices
We offer information as a service to you. The provided information is based on your requirements and we
make every effort to ensure its quality. You agree that you are responsible for using independent analysis
and evaluation in designing intended products, and we provide reference designs for illustrative purposes
only. Before using any hardware, software or service guided by this document, please read this notice
carefully. Even though we employ commercially reasonable efforts to provide the best possible
experience, you hereby acknowledge and agree that this document and related services hereunder are
provided to you on an “as available” basis. We may revise or restate this document from time to time at
our sole discretion without any prior notice to you.

Use and Disclosure Restrictions


License Agreements
Documents and information provided by us shall be kept confidential, unless specific permission is
granted. They shall not be accessed or used for any purpose except as expressly provided herein.

Copyright
Our and third-party products hereunder may contain copyrighted material. Such copyrighted material
shall not be copied, reproduced, distributed, merged, published, translated, or modified without prior
written consent. We and the third party have exclusive rights over copyrighted material. No license shall
be granted or conveyed under any patents, copyrights, trademarks, or service mark rights. To avoid
ambiguities, purchasing in any form cannot be deemed as granting a license other than the normal
non-exclusive, royalty-free license to use the material. We reserve the right to take legal action for
noncompliance with abovementioned requirements, unauthorized use, or other illegal or malicious use of
the material.

BG96_HTTP(S)_Application_Note 1 / 36
LPWA Module Series

Trademarks
Except as otherwise set forth herein, nothing in this document shall be construed as conferring any rights
to use any trademark, trade name or name, abbreviation, or counterfeit product thereof owned by Quectel
or any third party in advertising, publicity, or other aspects.

Third-Party Rights
This document may refer to hardware, software and/or documentation owned by one or more third parties
(“third-party materials”). Use of such third-party materials shall be governed by all restrictions and
obligations applicable thereto.

We make no warranty or representation, either express or implied, regarding the third-party materials,
including but not limited to any implied or statutory, warranties of merchantability or fitness for a particular
purpose, quiet enjoyment, system integration, information accuracy, and non-infringement of any
third-party intellectual property rights with regard to the licensed technology or use thereof. Nothing herein
constitutes a representation or warranty by us to either develop, enhance, modify, distribute, market, sell,
offer for sale, or otherwise maintain production of any our products or any other hardware, software,
device, tool, information, or product. We moreover disclaim any and all warranties arising from the course
of dealing or usage of trade.

Privacy Policy
To implement module functionality, certain device data are uploaded to Quectel’s or third-party’s servers,
including carriers, chipset suppliers or customer-designated servers. Quectel, strictly abiding by the
relevant laws and regulations, shall retain, use, disclose or otherwise process relevant data for the
purpose of performing the service only or as permitted by applicable laws. Before data interaction with
third parties, please be informed of their privacy and data security policy.

Disclaimer
a) We acknowledge no liability for any injury or damage arising from the reliance upon the information.
b) We shall bear no liability resulting from any inaccuracies or omissions, or from the use of the
information contained herein.
c) While we have made every effort to ensure that the functions and features under development are
free from errors, it is possible that they could contain errors, inaccuracies, and omissions. Unless
otherwise provided by valid agreement, we make no warranties of any kind, either implied or express,
and exclude all liability for any loss or damage suffered in connection with the use of features and
functions under development, to the maximum extent permitted by law, regardless of whether such
loss or damage may have been foreseeable.
d) We are not responsible for the accessibility, safety, accuracy, availability, legality, or completeness of
information, advertising, commercial offers, products, services, and materials on third-party websites
and third-party resources.

Copyright © Quectel Wireless Solutions Co., Ltd. 2025. All rights reserved.

BG96_HTTP(S)_Application_Note 2 / 36
LPWA Module Series

About the Document

Revision History
Version Date Author Description

Sherlock ZHAO/
- 2017-11-23 Parker ZHOU/ Creation of the document
Ethan YAN
Sherlock ZHAO/
1.0 2017-11-23 Parker ZHOU/ First official release
Ethan YAN
1. Updated the document name.
2. Added the introduction of AT command and the
declaration of AT command examples
1.1 2025-01-02 Terrence YANG (Chapter 2.1, 2.2).
3. Updated URL and IP addresses in examples
(Chapter 1.2.1, 3.1.1, [Link], [Link], 3.2.1, [Link],
[Link]).

BG96_HTTP(S)_Application_Note 3 / 36
LPWA Module Series

Contents

About the Document ................................................................................................................................... 3


Contents ....................................................................................................................................................... 4
Table Index ................................................................................................................................................... 6

1 Introduction .......................................................................................................................................... 7
1.1. The Process of Using HTTP(S) AT Commands ...................................................................... 7
1.2. Description of HTTP(S) Header .............................................................................................. 8
1.2.1. Customize HTTP(S) Request Header ............................................................................. 8
1.2.2. Output HTTP(S) Response Header ................................................................................. 8
1.3. Description of Data Mode ........................................................................................................ 9

2 Description of HTTP(S) AT Commands ........................................................................................... 10


2.1. AT Command Introduction ..................................................................................................... 10
2.1.1. Definitions....................................................................................................................... 10
2.1.2. AT Command Syntax ..................................................................................................... 10
2.2. Declaration of AT Command Examples ................................................................................ 11
2.3. AT+QHTTPCFG Configure Parameters for HTTP(S) Server ............................................. 11
2.4. AT+QHTTPURL Set URL of HTTP(S) Server .................................................................... 13
2.5. AT+QHTTPGET Send GET Request to HTTP(S) Server .................................................. 14
2.6. AT+QHTTPPOST Send POST Request to HTTP(S) Server via UART/USB .................... 16
2.7. AT+QHTTPPOSTFILE Send POST Request to HTTP(S) Server via File ......................... 18
2.8. AT+QHTTPREAD Read Response from HTTP(S) Server via UART/USB ........................ 19
2.9. AT+QHTTPREADFILE Read Response from HTTP(S) Server via File ............................ 20

3 Examples ............................................................................................................................................ 21
3.1. Access to HTTP Server ......................................................................................................... 21
3.1.1. Send HTTP GET Request and Read the Response ..................................................... 21
3.1.2. Send HTTP POST Request and Read the Response ................................................... 22
[Link]. Post Body Obtained from UART/USB .................................................................. 22
[Link]. Post Body Obtained from File System ................................................................. 23
3.2. Access to HTTPS Server ...................................................................................................... 24
3.2.1. Send HTTPS GET Request and Read the Response ................................................... 24
3.2.2. Send HTTPS POST Request and Read the Response ................................................ 26
[Link]. Post Body Obtained from UART/USB .................................................................. 26
[Link]. Post Body Obtained from File System ................................................................. 28

4 Error Handling .................................................................................................................................... 30


4.1. Executing HTTP(S) AT Commands Fails .............................................................................. 30
4.2. PDP Activation Fails .............................................................................................................. 30
4.3. DNS Parse Fails .................................................................................................................... 30
4.4. Entering Data Mode Fails ...................................................................................................... 31
4.5. Sending GET/POST Requests Fails ..................................................................................... 31
4.6. Reading Response Fails ....................................................................................................... 31

BG96_HTTP(S)_Application_Note 4 / 36
LPWA Module Series

5 Summary of ERROR Codes .............................................................................................................. 33

6 Summary of HTTP(S) Response Codes .......................................................................................... 35

7 Appendix References ........................................................................................................................ 36

BG96_HTTP(S)_Application_Note 5 / 36
LPWA Module Series

Table Index

Table 1: Type of AT Commands ......................................................................................................................... 10


Table 2: Summary of Error Codes ..................................................................................................................... 33
Table 3: Summary of HTTP(S) Response Codes .............................................................................................. 35
Table 4: Related Documents ............................................................................................................................. 36
Table 5: Terms and Abbreviations ...................................................................................................................... 36

BG96_HTTP(S)_Application_Note 6 / 36
LPWA Module Series

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

1.1. The Process of Using HTTP(S) AT Commands

Through BG96 TCP/IP AT commands, customers can configure a PDP context, activate/deactivate the
PDP context and query the PDP context status. And through BG96 HTTP(S) AT commands, customers
can send HTTP(S) GET/POST requests to HTTP(S) server, and read HTTP(S) response from HTTP(S)
server. The general process is as follows:

Step 1: Configure <APN>, <username>, <password> and other parameters of a PDP context by
AT+QICSGP. Please refer to document [1] for details. If QoS settings need to be updated,
configure them by AT+CGQMIN, AT+CGEQMIN, AT+CGQREQ and AT+CGEQREQ commands.
For more details, please refer to document [2].

Step 2: Activate the PDP context by AT+QIACT, then the assigned IP address can be queried by
AT+QIACT?. Please refer to document [1] for details.

Step 3: Configure the PDP context ID and SSL context ID by AT+QHTTPCFG command.

Step 4: Configure SSL context parameters by AT+QSSLCFG command. For more details, please refer
to document [3].

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

Step 6: Send HTTP(S) request. AT+QHTTPGET command can be used for sending HTTP(S) GET
request, and AT+QHTTPPOST or QHTTPOSTFILE command can be used for sending HTTP(S)
POST request.

Step 7: Read HTTP(S) response information by AT+QHTTPREAD or QHTTPREADFILE command.

Step 8: Deactivate the PDP context by AT+QIDEACT command. For more details, please refer to
document [1] .

BG96_HTTP(S)_Application_Note 7 / 36
LPWA Module Series

1.2. Description of HTTP(S) Header

1.2.1. Customize HTTP(S) Request Header

HTTP(S) request header is filled by the module automatically. HTTP(S) request header can be
customized by configuring <request_header> as 1 via AT+QHTTPCFG command, and then inputting
HTTP(S) request header according to the following requirements:

1. Follow HTTP(S) header syntax.


2. The value of URI in HTTP(S) request line and the “Host:” header must be in line with the URL
configured by AT+QHTTPURL command.
3. The HTTP(S) request header must end with <CR><LF>.

The following example shows a valid HTTP(S) POST request header:

POST /[Link] HTTP/1.1<CR><LF>


Host: [Link]:8011<CR><LF>
Accept: */*<CR><LF>
User-Agent: QUECTEL_MODULE<CR><LF>
Connection: Keep-Alive<CR><LF>
Content-Type: application/x-www-form-urlencoded<CR><LF>
Content-Length: 48<CR><LF>
<CR><LF>
Message=1111&Appleqty=2222&Orangeqty=3333&find=1

1.2.2. Output HTTP(S) Response Header

HTTP(S) response header will not be outputted automatically. HTTP(S) response header information can
be obtained by configuring <response header> to 1 via AT+QHTTPCFG command, and then HTTP(S)
response header will be outputted with HTTP(S) response body after executing AT+QHTTPREAD or
AT+QHTTPREADFILE command.

BG96_HTTP(S)_Application_Note 8 / 36
LPWA Module Series

1.3. Description of Data Mode

The COM port of BG96 module has two working modes: AT command mode and data mode. In AT
command mode, the inputted data via COM port will be treated as AT command. While in data mode, it
will be treated as data.

Inputting “+++” or pulling up DTR (AT&D1 should be set first) can make the COM port exit from data mode.
To prevent the “+++” from being misinterpreted as data, the following sequence should be followed:
1) Do not input any character within 1s or longer before inputting “+++”.
2) Input “+++” within 1s, and no other characters can be inputted during the time.
3) Do not input any character within 1s after “+++” has been inputted.

When AT+QHTTPURL, AT+QHTTPOST and AT+QHTTPREAD are executed, the COM port will enter
data mode. If customers are using “+++” or DTR to make the port exit from data mode, the executing
procedure of these commands will be interrupted before the response is returned. In such case, the COM
port cannot reenter data mode by executing ATO command.

BG96_HTTP(S)_Application_Note 9 / 36
LPWA Module Series

2 Description of HTTP(S) AT Commands

2.1. AT Command Introduction

2.1.1. Definitions

⚫ <CR> Carriage return character.


⚫ <LF> Line feed character.
⚫ <...> Parameter name. Angle brackets do not appear on command line.
⚫ [...] Optional parameter of a command or an optional part of TA information response.
Square brackets do not appear on command line. When an optional parameter is
omitted, the new value equals its previous value or its default setting, unless otherwise
specified.
⚫ Underline Default setting of a parameter.

2.1.2. AT Command Syntax

The AT or at prefix must be added at the beginning of each command line. Entering <CR> will terminate a
command line. Commands are usually followed by a response that includes
<CR><LF><response><CR><LF>. Throughout this document, only the response <response> will be
presented, <CR><LF> are omitted intentionally.

Table 1: Type of AT Commands

Command Type Syntax Description

Test the existence of corresponding


Test Command AT+<cmd>=? command and to give information about the
type, value, or range of its parameter.
Check the current parameter value of a
Read Command AT+<cmd>?
corresponding command.

Write Command AT+<cmd>=<p1>[,<p2>[,<p3>[...]]] Set user-definable parameter value.

Return a specific information parameter or


Execution Command AT+<cmd>
perform a specific action.

BG96_HTTP(S)_Application_Note 10 / 36
LPWA Module Series

2.2. Declaration of AT Command Examples

The AT command examples in this document are provided to help you familiarize with AT commands and
learn how to use them. The examples, however, should not be taken as Quectel’s recommendation or
suggestions about how you should design a program flow or what status you should set the module into.
Sometimes multiple examples may be provided for one AT command. However, this does not mean that
there exists a correlation among these examples and that they should be executed in a given sequence.
The URLs, domain names, IP addresses, usernames/accounts, and passwords (if any) in the AT
command examples are provided for illustrative and explanatory purposes only, and they should be
modified to reflect your actual usage and specific needs.

2.3. AT+QHTTPCFG Configure Parameters for HTTP(S) Server

The command is used to configure the parameters for HTTP(S) server, including configuring a PDP
context ID, customizing HTTP(S) request header, outputting HTTP(S) 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 Response
AT+QHTTPCFG=? +QHTTPCFG: "contextid",(list of supported <contextID>s)
+QHTTPCFG: "requestheader",(list of supported
<request_header>s)
+QHTTPCFG: "responseheader",(list of supported
<request_header>s)
+QHTTPCFG: "sslctxid",(list of supported <sslctxID>s)
+QHTTPCFG: "contenttype",(list of supported
<content_type>s)

OK
Write Command Response
AT+QHTTPCFG="contextid"[,<contextI If <contextID> is not omitted:
D>] OK
Or
+CME ERROR: <err>

If <contextID> is omitted, query the current settings:


+QHTTPCFG: "contextid",<contextID>

OK
Write Command Response
AT+QHTTPCFG="requestheader"[,<re If <request_header> is not omitted:

BG96_HTTP(S)_Application_Note 11 / 36
LPWA Module Series

quest_header>] OK
Or
+CME ERROR: <err>

If <request_header> is omitted, query the current settings:


+QHTTPCFG: "requestheader",<request_header>

OK
Write Command Response
AT+QHTTPCFG="responseheader"[,<r If <response_header> is not omitted:
esponse_header>] OK
Or
+CME ERROR: <err>

If <response_header> is omitted, query the current


settings:
+QHTTPCFG: "responseheader",<response_header>

OK
Write Command Response
AT+QHTTPCFG="sslctxid"[,<sslctxID> If <sslctxID> is not omitted:
] OK
Or
+CME ERROR: <err>

If <sslctxID> is omitted, query the current settings:


+QHTTPCFG: "sslctxid",<sslctxID>

OK
Read Command Response
AT+QHTTPCFG? +QHTTPCFG: "contextid",<contextID>
+QHTTPCFG: "requestheader",<request_header>
+QHTTPCFG: "responseheader",<response_header>
+QHTTPCFG: "sslctxid",<sslctxID>
+QHTTPCFG: "contenttype",<content_type>

OK

Parameter

<contextID> Numeric type. PDP context ID. The range is 1-16, and the default value is 1.
<request_header> Numeric type. Disable or enable to customize HTTP(S) request header.
0 Disable

BG96_HTTP(S)_Application_Note 12 / 36
LPWA Module Series

1 Enable
<response_header> Numeric type. Disable or enable to output HTTP(S) response header.
0 Disable
1 Enable
<sslctxID> Numeric type. SSL context ID used for HTTP(S). The range is 0-5, and the
default value is 1. Customers should configure the SSL parameters by
AT+QSSLCFG. For details, please refer to document [3].
<content_type> Numeric type. Data type of HTTP(S) body.
0 application/x-www-form-urlencoded
1 text/plain
2 application/octet-stream
3 multipart/form-data
<err> Integer type. The error code of the operation. Please refer to Chapter 5.

2.4. AT+QHTTPURL Set URL of HTTP(S) Server

URL must begin with “[Link] or “[Link] which indicates you will access to an HTTP or HTTPS server.

AT+QHTTPURL Set URL of HTTP(S) Server


Test Command Response
AT+QHTTPURL=? +QHTTPURL: (list of supported <URL_length>s),(list of
supported <timeout>s)

OK
Write Command Response
AT+QHTTPURL=<URL_length>[,<tim a) If the parameter format is correct, and it is not sending
eout>] HTTP(S)GET/POST requests at present:
CONNECT

TA switches to transparent access mode, and the URL can be


inputted. When the total size of the inputted data reaches
<URL_length>, TA will return to command mode and report
the following code:
OK

If the <timeout> has reached, but the received length of URL


is less than <URL_length>, TA will return to command mode
and report the following code:
+CME ERROR: <err>

b) If the parameter format is incorrect or other errors occur:


+CME ERROR: <err>

BG96_HTTP(S)_Application_Note 13 / 36
LPWA Module Series

Read Command Response


AT+QHTTPURL? [+QHTTPURL: <URL><CR><LF>]
OK

Parameter
<URL_length> Numeric type. The length of URL. The range is 1–700. Unit: byte.
<timeout> Numeric type. The maximum time for inputting URL. The range is 1–65535, and
the default value is 60. Unit: second.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.

2.5. AT+QHTTPGET Send GET Request to HTTP(S) Server

According to the configured <request_header> parameter in AT+QHTTPCFG=“requestheader”[,


<request_header>] command, AT+HTTPGET Write Command has two different formats. If
<request_header> is set to 1, after AT+QHTTPGET command has been sent, “CONNECT” may be
outputted in 125s to indicate that the connection is successful. If it is not outputted during the time, then
"+CME ERROR: <err>" will be outputted.

After AT+HTTPGET Write Command has been sent, it is recommended to wait for a specific period of
time (refer to the maximum response time below) for "+QHTTPGET:
<err>[,<httprspcode>[,<content_length>]]" to be outputted after “OK” is reported.

In "+QHTTPGET: <err>[,<httprspcode>[,<content_length>]]", the <httprspcode> parameter can only


be reported when <err> equals 0. If HTTP(S) response header contains “CONTENT-LENGTH”
information, the <content_length> information will be reported.

AT+QHTTPGET Send GET Request to HTTP(S) Server


Test Command Response
AT+QHTTPGET=? +QHTTPGET: (list of supported <rsptime>s),(list of
supported <data_length>s),(list of supported <input_time>s)

OK
If <request_header> equals 0 (disable Response
to customize HTTP(S) request header) a) If the parameter format is correct and no other errors occur:
Write Command OK
AT+QHTTPGET[=<rsptime>]
When the module has received response from HTTP(S)
server, it will report the following URC:
+QHTTPGET: <err>[,<httprspcode>[,<content_length>]]

b) If the parameter format is incorrect or other errors occur:

BG96_HTTP(S)_Application_Note 14 / 36
LPWA Module Series

+CME ERROR: <err>

If <request_header> equals 1 (enable to Response


customize HTTP(S) request header) a) If HTTP(S) server is connected successfully:
Write Command CONNECT
AT+QHTTPGET=<rsptime>,<data_len
gth>[,<input_time>] TA switches to transparent access mode, and the HTTP(S)
GET request header can be inputted. When the total size of
the inputted data reaches <data_length>, TA will return to
command mode and report the following code:
OK

When the module has received response from HTTP(S)


server, it will report the following URC:
+QHTTPGET: <err>[,<httprspcode>[,<content_length>]]

If the <input_time> has reached, but the length of received


data is less than <data_length>, TA will return to command
mode and report the following code:
+CME ERROR: <err>

b) If the parameter format is incorrect or other errors occur:


+CME ERROR: <err>
Maximum Response Time Determined by <rsptime>

Parameter
<rsptime> Numeric type. The range is 1–65535, and the default value is 60. Unit: second. It
is used to configure the timeout for the HTTP(S) GET response "+QHTTPGET:
<err>[,<httprspcode>,<content_length>]" to be outputted after "OK" is
returned.
<data_length> Numeric type. The length of HTTP(S) request information, including HTTP(S)
request header and HTTP(S) request body. The range is 1–2048. Unit: byte.
<input_time> Numeric type. The maximum time for inputting HTTP(S) request
information. The range is 1–65535, and the default value is 60. Unit: second.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
<httprspcode> Please refer to Chapter 6.
<request_header> Please refer to Chapter 2.3.
<content_length> Numeric type. The length of HTTP(S) response body. Unit: byte.

BG96_HTTP(S)_Application_Note 15 / 36
LPWA Module Series

2.6. AT+QHTTPPOST Send POST Request to HTTP(S) Server via

UART/USB

The command is used to send HTTP(S) POST request. According to the configured <request_header>
parameter in AT+QHTTPCFG="requestheader"[,<request_header>] command, the AT+HTTPPOST
Write Command has two different formats. If <request_header> is set to 0, post body should be inputted
via UART/USB port. If <request_header> is set to 1, then both post header and body should be inputted
via UART/USB port.

After AT+QHTTPPOST command has been sent, “CONNECT” may be outputted in 125s to indicate the
connection is successful. If it is not received during the time, " +CME ERROR: <err>" will be outputted.

It is recommended to wait for a specific period of time (refer to the maximum response time below) for
"+QHTTPPOST: <err>[,<httprspcode>[,<content_length>]]" to be outputted after "OK" is reported.

AT+QHTTPPOST Send POST Request to HTTP(S) Server via UART/USB


Test Command Response
AT+QHTTPPOST=? +QHTTPPOST: (list of supported <data_length>s),(list of
supported <input_time>s),(list of supported <rsptime>s)

OK
If <request_header> equals 0 (disable Response
to customize HTTP(S) request header) a) If the parameter format is correct and HTTP(S) server is
Write Command connected successfully and HTTP(S) request header is sent
AT+QHTTPPOST=<data_length>[,<in completely, it will prompt you to input body:
put_time>,<rsptime>] CONNECT

TA switches to transparent access mode, and the HTTP(S)


POST body can be inputted. When the total size of the
inputted data reaches <data_length>, TA will return to
command mode and report the following code:
OK

When the module has received response from HTTP(S)


server, it will report the following URC:
+QHTTPPOST: <err>[,<httprspcode>[,<content_length>]]

If the <input_time> has reached, but the received length of


data is less than <data_length>, TA will return to command
mode and report the following code:
+CME ERROR: <err>

BG96_HTTP(S)_Application_Note 16 / 36
LPWA Module Series

b) If the parameter format is incorrect or other errors occur:


+CME ERROR: <err>
If <request_header> equals 1 (enable Response
to customize HTTP(S) request header) a) If the parameter format is correct and HTTP(S) server is
Write Command connected successfully:
AT+QHTTPPOST=<data_length>[,<in CONNECT
put_time>,<rsptime>]
TA switches to the transparent access mode, and the
HTTP(S) POST header and body can be inputted. When the
total size of the inputted data reaches <data_length>, TA will
return to command mode and report the following code:
OK

When the module has received response from HTTP(S)


server, it will report the following URC:
+QHTTPPOST: <err>[,<httprspcode>[,<content_length>]]

If the <input_time> has reached, but the length of received


data is less than <data_length>, TA will return to command
mode and report the following code:
+CME ERROR: <err>

b) If the parameter format is incorrect or other errors occur:


+CME ERROR: <err>

Maximum Response Time Determined by network and <rsptime>

Parameter
<data_length> Numeric type. If <request_header> is 0, it indicates the length of post body,
and if <request_header> is 1, it indicates the length of HTTP(S) request
information, including HTTP(S) request header and HTTP(S) request body.
The range is 1–1024000. Unit: byte.
<input_time> Numeric type. The maximum time for inputting post body or HTTP(S) request
information. The range is 1-65535, and the default value is 60. Unit: second.
<rsptime> Numeric type. The range is 1–65535, and the default value is 60. Unit:
second. It is used to configure the timeout for the HTTP(S) POST response
"+QHTTPPOST: <err>[,<httprspcode>[,<content_length>]]" to be
outputted after "OK" is returned.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
<httprspcode> Please refer to Chapter 6.
<request_header> Please refer to Chapter 2.3.
<content_length> Numeric type. The length of HTTP(S) response body. Unit: byte.

BG96_HTTP(S)_Application_Note 17 / 36
LPWA Module Series

2.7. AT+QHTTPPOSTFILE Send POST Request to HTTP(S) Server via

File

The command can be used to send HTTP(S) POST request via file. According to the <request_header>
in AT+QHTTPCFG="requestheader"[,<request_header>] command, the file operated by
AT+HTTPPOSTFILE command has two different formats. If <request_header> is set to 0, the file in file
system will be post body. If <request_header> is set to 1, the file in file system will be post header and
body.

The module will report "+QHTTPPOSTFILE: <err>[,<httprspcode>[,<content_length>]]" information to


indicate the executing result of AT+QHTTPPOSFILE command. The <httprspcode> parameter can only
be reported when <err> equals 0.

It is recommended to wait for a specific period of time (refer to the maximum response time below) for
"+QHTTPPOSTFILE: <err>[,<httprspcode>[,<content_length>]]" to be outputted after "OK" is
reported.

AT+QHTTPPOSTFILE Send POST Request to HTTP(S) Server via File


Test Command Response
AT+QHTTPPOSTFILE=? +QHTTPPOSTFILE: <file_name>,(list of supported
<rsptime>s)

OK
Write Command Response
AT+QHTTPPOSTFILE=<file_name>[,< a) If parameter format is correct and HTTP(S) server is
rsptime>] connected successfully:
If <request_header> equals 1, the OK
specified file must contain HTTP(S)
request header information. When the module has received response from HTTP(S)
server, it will report the following URC:
+QHTTPPOSTFILE:
<err>[,<httprspcode>,<content_length>]

b) If parameter format is incorrect or other errors occur:


+CME ERROR: <err>

Maximum Response Time Determined by <rsptime>

Parameter
<file_name> String type. File name. The max length of file name is 80 bytes.
<rsptime> Numeric type. The range is 1–65535, and the default value is 60. Unit:

BG96_HTTP(S)_Application_Note 18 / 36
LPWA Module Series

second. It is used to configure the timeout for the HTTP(S) POST response
"+QHTTPPOSTFILE: <err>[,<httprspcode>,<content_length>]" to be
outputted after "OK" is returned.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
<httprspcode> Please refer to Chapter 6.
<request_header> Please refer to Chapter 2.3.
<content_length> Numeric type. The length of HTTP(S) response body.

2.8. AT+QHTTPREAD Read Response from HTTP(S) Server via

UART/USB

After sending HTTP(S) GET/POST requests, customers can retrieve HTTP(S) response information
from HTTP(S) server via UART/USB port by AT+QHTTPREAD command. "+QHTTPGET: <err>[,<
httprspcode>[,<content_length>]]", "+QHTTPPOST: <err>[,<httprspcode>[,<content_length>]]"
or "+QHTTPPOSTFILE: <err>[,<httprspcode>,<content_length>]" information must be received
before executing AT+QHTTPREAD command.

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


Test Command Response
AT+QHTTPREAD=? +QHTTPREAD: (list of supported <wait_time>s)

OK
Write Command Response
AT+QHTTPREAD[=<wait_time>] a) If the parameter format is correct and read successfully:
CONNECT
<Output HTTP(S) response information>
OK

+QHTTPREAD: <err>

If <wait_time> reaches or other errors occur, but body has


not been outputted completely, it will report the following code:
+CME ERROR: <err>

b) If the parameter format is incorrect or other errors occur:


+CME ERROR: <err>

Parameter
<wait_time> Numeric type. The maximum interval time between receiving two packets of data.
The range is 1–65535, and the default value is 60. Unit: second.

BG96_HTTP(S)_Application_Note 19 / 36
LPWA Module Series

<err> Integer type. The error code of the operation. Please refer to Chapter 5.

2.9. AT+QHTTPREADFILE Read Response from HTTP(S) Server via File

After sending HTTP(S) GET/POST requests, customers can retrieve HTTP(S) response information from
HTTP(S) server via file by AT+QHTTPREADFILE. And "+QHTTPGET:
<err>[,<httprspcode>[,<content_length>]]", "+QHTTPPOST:
<err>[,<httprspcode>[,<content_length>]]" or "+QHTTPPOSTFILE:
<err>[,<httprspcode>,<content_length>]" information must be received before executing
AT+QHTTPREADFILE command.

AT+QHTTPREADFILE Read Response from HTTP(S) Server via File


Test Command Response
AT+QHTTPREADFILE=? +QHTTPREADFILE: <file_name>,(list of supported
<wait_time>s)

OK
Write Command Response
AT+QHTTPREADFILE=<file_name>[, a) If the parameter format is correct:
<wait_time>] OK

When body is read over or <wait_time> reaches, it will report:


+QHTTPREADFILE: <err>

b) If the parameter format is incorrect or other errors occur:


+CME ERROR: <err>

Parameter
<wait_time> Numeric type. The maximum interval time between receiving two packets of
data. The range is 1–65535, and the default value is 60. Unit: second.
<file_name> String type. File name. The max length of file name is 80 bytes.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.

BG96_HTTP(S)_Application_Note 20 / 36
LPWA Module Series

3 Examples

3.1. Access to HTTP Server

3.1.1. Send HTTP GET Request and Read the Response

The following examples show how to send HTTP GET request and enable output of HTTP response
header, as well as how to read HTTP GET response.

//Example of how to send HTTP GET response.


AT+QHTTPCFG="contextid",1 //Configure the PDP context ID as 1.
OK
AT+QHTTPCFG="responseheader",1 //Allow to output HTTP response header.
OK
AT+QIACT? //Query the state of context.
OK
AT+QICSGP=1,1, "UNINET","","",1 //Configure PDP context 1. APN is “UNINET” for China Unicom.
OK
AT+QIACT=1 //Activate context 1.
OK //Activated successfully.
AT+QIACT? //Query the state of context.
+QIACT: 1,1,1,"[Link]"

OK
AT+QHTTPURL=26,80 //Set the URL which will be accessed.
CONNECT
[Link] //Input URL whose length is 26 bytes. (This URL is only an
example. Please input the correct URL in practical test.)
OK
AT+QHTTPGET=80 //Send HTTP GET request and the maximum response time is
80s.
OK

+QHTTPGET: 0,200,547256 //If HTTP response header contains “CONTENT-LENGTH”


information, then the <content_length> information will be
reported.

//Example of how to read HTTP response.

BG96_HTTP(S)_Application_Note 21 / 36
LPWA Module Series

//Solution 1: Read HTTP response information and output it via UART port.
AT+QHTTPREAD=80 //Read HTTP response information and output it via UART.
The maximum time to wait for HTTP session to be closed is
80s.
CONNECT
HTTP/1.1 200 OK <CR><LF> //HTTP response header and body.
Content-Type: text/html<CR><LF>
Vary: Accept-Encoding<CR><LF>
X-Powered-By: shci_v1.03<CR><LF>
Server: nginx<CR><LF>
Date: Fri, 27 Dec 2013 02:21:43 GMT<CR><LF>
Last-Modified: Fri, 27 Dec 2013 02:20:01 GMT<CR><LF>
Expires: Fri, 27 Dec 2013 02:22:43 GMT<CR><LF>
Cache-Control: max-age=60<CR><LF>
Age: 1<CR><LF>
Content-Length: 547256<CR><LF>
X-Cache: HIT from [Link]<CR><LF>
<CR><LF>
<body>
OK

+QHTTPREAD: 0 //Read HTTP response header and body successfully.

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


AT+QHTTPREADFILE="[Link]",80 //Read HTTP response header and body and store them to
“[Link]”, the maximum time to wait for HTTP session to close is
80s.
OK

+QHTTPREADFILE: 0 //HTTP response header and body are stored successfully.

3.1.2. Send HTTP POST Request and Read the Response

[Link]. Post Body Obtained from UART/USB

The following examples show how to send HTTP POST request and retrieve post body via UART port, as
well as how to read HTTP POST response.

AT+QHTTPCFG="contextid",1 //Configure the PDP context ID as 1.


OK
AT+QIACT? //Query the state of context.
OK
AT+QICSGP=1,1, "UNINET","","",1 //Configure PDP context 1. APN is “UNINET” for China Unicom.

BG96_HTTP(S)_Application_Note 22 / 36
LPWA Module Series

OK
AT+QIACT=1 //Activate context 1.
OK //Activated successfully.
AT+QIACT? //Query the state of context.
+QIACT: 1,1,1,"[Link]"

OK
AT+QHTTPURL=60,80 //Set the URL which will be accessed.
CONNECT
[Link] //Input URL whose length is 60
bytes. (This URL is only an
example. Please input the
correct URL in practical test.)
OK
AT+QHTTPPOST=20,80,80 //Send HTTP POST request. POST body is obtained via UART.
The maximum input body time is 80s and the maximum
response time is 80s.
CONNECT
Message=HelloQuectel //Input post body whose length is 20 bytes. (The post body is
only an example. Please input the correct post body in
practical test.)
OK

+QHTTPPOST: 0,200,177 //If the HTTP response header contains “CONTENT-LENGTH”


information, then the <content_length> information will be
reported.
AT+QHTTPREAD=80 //Read HTTP response body and output it via UART. The
maximum time to wait for HTTP session to be closed is 80s.
CONNECT
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="httpHTTPs://[Link]/webservices2.3">Message='HelloQuectel' ASCII:72
101 108 108 111 81 117 101 99 116 101 108 </string> //Output HTTP response body.
OK

+QHTTPREAD: 0 //HTTP response body is outputted successfully.

[Link]. Post Body Obtained from File System

The following examples show how to send HTTP POST request and retrieve post body via file system, as
well as how to store HTTP POST response to file system.

AT+QHTTPCFG="contextid",1 //Configure the PDP context ID as 1.


OK
AT+QIACT? //Query the state of context.

BG96_HTTP(S)_Application_Note 23 / 36
LPWA Module Series

OK
AT+QICSGP=1,1, "UNINET","","",1 //Configure PDP context 1. APN is “UNINET” for China Unicom.
OK
AT+QIACT=1 //Activate context 1.
OK //Activated successfully.
AT+QIACT? //Query the state of context.
+QIACT: 1,1,1,"[Link]"

OK
AT+QHTTPURL=60,80 //Set the URL which will be accessed.
CONNECT
[Link] //Input URL whose length is 60
bytes. (This URL is only an
example. Please input the
correct URL in practical test.)
OK

//POST request information from UFS file, and read HTTP response information and store it to UFS file.
AT+QHTTPPOSTFILE="[Link]",80 //Send HTTP POST request. POST body is obtained from
“[Link]”, and the maximum response time is 80s.
OK

+QHTTPPOSTFILE: 0,200,177 //After HTTP POST request is sent successfully, you can
execute AT+QHTTPREAD command.
AT+QHTTPREADFILE="[Link]",80 //Read HTTP response body and store it to “[Link]”, the
maximum time to wait for HTTP session to close is 80s.
OK

+QHTTPREADFILE: 0 //HTTP response body is stored successfully.

3.2. Access to HTTPS Server

3.2.1. Send HTTPS GET Request and Read the Response

The following examples show how to send HTTPS GET request and enable output of HTTPS response
header, as well as how to read HTTPS GET response.

//Example of how to send HTTPS GET request.


AT+QHTTPCFG="contextid",1 //Configure the PDP context ID as 1.
OK
AT+QHTTPCFG="responseheader",1 //Allow to output HTTPS response header.
OK
AT+QIACT? //Query the state of context.

BG96_HTTP(S)_Application_Note 24 / 36
LPWA Module Series

OK
AT+QICSGP=1,1, "UNINET","","",1 //Configure PDP context 1. APN is “UNINET” for China Unicom.
OK
AT+QIACT=1 //Activate context 1.
OK //Activated successfully.
AT+QIACT? //Query the state of context.
+QIACT: 1,1,1,"[Link]"

OK
AT+QHTTPCFG="sslctxid",1 //Set SSL context ID.
OK
AT+QSSLCFG="sslversion",1,1 //Set SSL version as 1 which means TLSV1.0.
OK
AT+QSSLCFG="ciphersuite",1,0x0005 //Set SSL cipher suite as 0x0005 which means RC4-SHA.
OK
AT+QSSLCFG="seclevel",1,0 //Set SSL verify level as 0 which means you do not need any
CA certificate.
OK
AT+QHTTPURL=23,80 //Set the URL which will be accessed.
CONNECT
[Link] //Input URL whose length is 23 bytes. (This URL is only an
example. Please input the correct URL in practical test.)
OK
AT+QHTTPGET=80 //Send HTTPS GET request and the maximum response time
is 80s.
OK

+QHTTPGET: 0,200,21472 //If the HTTPS response header contains “CONTENT-LENGTH”


information, then the <content_length> information will be
reported.

//Example of how to read HTTPS response.


//Solution 1: Read HTTPS response information and output it via UART.
AT+QHTTPREAD=80 //Read HTTPS response information and output it via UART.
The maximum time to wait for HTTPS session to be closed is
80s.
CONNECT //HTTPS response header and body.
HTTP/1.1 200 OK<CR><LF>
Server: nginx/1.2.7<CR><LF>
Date: Fri, 27 Dec 2013 02:38:27 GMT<CR><LF>
Content-Type: text/html; charset=GB18030<CR><LF>
Content-Length: 10750<CR><LF>
Connection: keep-alive<CR><LF>
<CR><LF>

BG96_HTTP(S)_Application_Note 25 / 36
LPWA Module Series

<body>
OK

+QHTTPREAD: 0 //Read HTTPS response header and body successfully.

//Solution 2: Read HTTPS response information and store it to UFS file.


AT+QHTTPREADFILE="[Link]",80 //Read HTTPS response header and body and store it to “[Link]”.
The maximum time to wait for HTTPS session to be closed is
80s.
OK

+QHTTPREADFILE: 0 //HTTPS response header and body are stored successfully.

3.2.2. Send HTTPS POST Request and Read the Response

[Link]. Post Body Obtained from UART/USB

The following examples show how to send HTTPS POST request and retrieve post body via UART port,
as well as how to read HTTPS POST response.

AT+QHTTPCFG="contextid",1 //Configure the PDP context ID as 1.


OK
AT+QIACT? //Query the state of context.
OK
AT+QICSGP=1,1, "UNINET","","",1 //Configure PDP context 1. APN is “UNINET” for China Unicom.
OK
AT+QIACT=1 //Activate context 1.
OK //Activated successfully.
AT+QIACT? //Query the state of context.
+QIACT: 1,1,1,"[Link]"

OK
AT+QHTTPCFG="sslctxid",1 //Set SSL context ID.
OK
AT+QSSLCFG="sslversion",1,1 //Set SSL version as 1 which means TLsV1.0.
OK
AT+QSSLCFG="ciphersuite",1,0x0005 //Set SSL cipher suite as 0x0005 which means RC4-SHA.
OK
AT+QSSLCFG="seclevel",1,2 //Set SSL verify level as 2 which means you should upload CA
certificate, client certificate and client private key by
AT+QFUPL command.
OK
AT+QSSLCFG="cacert",1, "[Link]"

BG96_HTTP(S)_Application_Note 26 / 36
LPWA Module Series

OK
AT+QSSLCFG="clientcert",1, "[Link]"
OK
AT+QSSLCFG="clientkey",1, "[Link]"
OK
AT+QHTTPURL=39,80 //Set the URL which will be accessed.
CONNECT
HTTPs://[Link]:8011/[Link] //Input URL whose length is 39 bytes. (This URL is only
an example. Please input the correct URL in
practical test.)
OK
AT+QHTTPPOST=48,80,80 //Send HTTPS POST request. POST body is obtained from UART.
The maximum input body time is 80s and the maximum
response time is 80s.
CONNECT
Message=1111&Appleqty=2222&Orangeqty=3333&find=1 //Input post body whose length is 48 bytes.
(This post body is only an example.
Please input the correct one in practical
test.)
OK

+QHTTPPOST: 0,200,285 //If the HTTPS response header contains “CONTENT-LENGTH”


information, then the <content_length> information will be
reported.
AT+QHTTPREAD=80 //Read HTTPS response body and output it via UART. The
maximum time to wait for HTTPS session to be closed is 80s.
CONNECT //Read HTTPS response body successfully.
<html>
<head>
<title>Quectel's Auto Parts - Order Results</title>
</head>
<body>
<h1>Quectel's Auto Parts</h1>
<h2>Order Results</h2>

<p>Order processed at 02:49, 27th December</p><p>Your order is as follows: </p>1111


message<br />2222 apple<br />3333 orange<br /></body>
</html>

OK

+QHTTPREAD: 0 //HTTPS response body is outputted successfully.

BG96_HTTP(S)_Application_Note 27 / 36
LPWA Module Series

[Link]. Post Body Obtained from File System

The following examples show how to send HTTPS POST request and retrieve post body from file system,
as well as how to store HTTPS POST response to file system.

AT+QHTTPCFG="contextid",1 //Configure the PDP context ID as 1.


OK
AT+QIACT? //Query the state of context.
OK
AT+QICSGP=1,1, "UNINET","","",1 //Configure PDP context 1. APN is “UNINET” for China Unicom.
OK
AT+QIACT=1 //Activate context 1.
OK //Activated successfully.
AT+QIACT? //Query the state of context.
+QIACT: 1,1,1,"[Link]"

OK
AT+QHTTPCFG="sslctxid",1 //Set SSL context ID.
OK
AT+QSSLCFG="sslversion",1,1 //Set SSL version as 1 which means TLsV1.0.
OK
AT+QSSLCFG="ciphersuite",1,0x0005 //Set SSL cipher suite as 0x0005 which means RC4-SHA.
OK
AT+QSSLCFG="seclevel",1,2 //Set SSL verify level as 2 which means you should upload CA
certificate, client certificate and client private key by
AT+QFUPL command.
OK
AT+QSSLCFG="cacert",1, "[Link]"
OK
AT+QSSLCFG="clientcert",1, "[Link]"
OK
AT+QSSLCFG="clientkey",1, "[Link]"
OK
AT+QHTTPURL=39,80 //Set the URL which will be accessed.
CONNECT
http 错误!超链接引用无效。 //Input URL whose length is 39 bytes. (This URL is only an example. Please
input the correct URL in practical test.)
OK

//POST request information from UFS file, and read HTTPS response information and store it to UFS file.
AT+QHTTPPOSTFILE="[Link]",80 //Send HTTPS POST request. POST body is obtained from
“[Link]”, and the maximum response time is 80s.
OK
+QHTTPPOSTFILE: 0,200,285 //After HTTPS POST request is sent successfully, you can

BG96_HTTP(S)_Application_Note 28 / 36
LPWA Module Series

execute command AT+QHTTPREAD.


AT+QHTTPREADFILE="[Link]",80 //Read HTTPS response body and store it to “[Link]”. The
maximum time to wait for HTTPS session to be closed is 80s.
OK

+QHTTPREADFILE: 0 //HTTPS response body is stored successfully.

BG96_HTTP(S)_Application_Note 29 / 36
LPWA Module Series

4 Error Handling

4.1. Executing HTTP(S) AT Commands Fails

When executing HTTP(S) AT commands, if "ERROR" response is received from the module, please
check whether the (U)SIM card is inserted and whether it is "+CPIN: READY" returned when executing
AT+CPIN?.

4.2. PDP Activation Fails

If it is failed to active a PDP context by AT+QIACT command, please check the following configurations:

1. Query whether the PS domain is attached or not by AT+CGATT? command. If not, please execute
AT+CGATT=1 command to attach the 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 According to 3GPP specifications, the module only supports three PDP contexts activated
simultaneously, so customers must make sure the number of activated PDP contexts is less than 3.

If all above configurations are correct, but activating the PDP context by AT+QIACT command still fails,
please reboot the module to resolve this issue. After rebooting the module, please check the
configurations mentioned above at least three times and each time at an interval of 10 minutes to avoid
frequently rebooting the module.

4.3. DNS Parse Fails

When executing AT+QHTTPGET, AT+QHTTPPOST and QHTTPPOSTFILE commands, if “+CME


ERROR: 714” (714: HTTP(S) DNS error) is returned, please check the following aspects:

BG96_HTTP(S)_Application_Note 30 / 36
LPWA Module Series

1. Make sure the domain name of HTTP(S) server is valid.


2. Query the status of the PDP context by AT+QIACT? command to make sure the specified PDP
context has been activated successfully.
3. Query the address of DNS server by AT+QIDNSCFG command to make sure the address of DNS
server is not “[Link]”.

If the DNS server address is “[Link]”, there are two solutions:

1. Reassign a valid DNS server address by AT+QIDNSCFG command.


2. Deactivate the PDP context by AT+QIDEACT command, and re-activate the PDP context via
AT+QIACT command.

4.4. Entering Data Mode Fails

When executing AT+QHTTPURL, AT+QHTTPGET, AT+QHTTPPOST and AT+QHTTPREAD commands,


if “+CME ERROR: 704” (704: HTTP(S) UART busy) is returned, please check whether there are other
ports in data mode, since the module only supports one port in data mode at a time. If any, please
re-execute these commands after other ports have exited from data mode.

4.5. Sending GET/POST Requests Fails

When executing AT+QHTTPGET, AT+QHTTPPOST and QHTTPPOSTFILE commands, if a failed result


is received, please check the following configurations:

1. Make sure the URL inputted via AT+HTTPURL command is valid and can be accessed.
2. Make sure the specified server supports GET/POST commands.
3. Make sure the PDP context has been activated successfully.

If all above configurations are correct, but sending GET/POST requests by AT+QHTTPGET,
AT+QHTTPPOST and AT+QHTTPPOSTFILE commands still fails, please deactivate the PDP context by
AT+QIDEACT and re-activate the PDP context by AT+QIACT to resolve this issue. If activating the PDP
context fails, please refer to Chapter 4.2 to resolve it.

4.6. Reading Response Fails

Before reading response by AT+QHTTPREAD and AT+QHTTPREADFILE commands, customers should


execute AT+QHTTPGET, AT+QHTTPPOST and AT+QHTTPPOSTFILE commands and the following
URC information will be reported:

BG96_HTTP(S)_Application_Note 31 / 36
LPWA Module Series

"+QHTTPGET: <err>[,<httprspcode>[,<content_length>]]"/
"+QHTTPPOST: <err>[,<httprspcode>[,<content_length>]]"/
"+QHTTPPOSTFILE: <err>[,<httprspcode>,<content_length>]"

During executing AT+QHTTTPREAD and AT+QHTTPREADFILE commands, if customers encounter


some errors, such as: “+CME ERROR: 717” (717: HTTP(S) socket read error), please resend HTTP(S)
GET/POST requests to HTTP(S) server by AT+QHTTPGET, AT+QHTTPPOST and
AT+QHTTPPOSTFILE commands. If sending GET/POST requests to HTTP(S) server fails, please refer
to Chapter 4.5 to resolve it.

BG96_HTTP(S)_Application_Note 32 / 36
LPWA Module Series

5 Summary of ERROR Codes


The error code <err> indicates an error related to mobile equipment or network. The details about <err>
are described in the following table.

Table 2: Summary of Error Codes

<err> Meaning

0 Operation successful

701 HTTP(S) unknown error

702 HTTP(S) timeout

703 HTTP(S) busy

704 HTTP(S) UART busy

705 HTTP(S) no GET/POST requests

706 HTTP(S) network busy

707 HTTP(S) network open failed

708 HTTP(S) network no configuration

709 HTTP(S) network deactivated

710 HTTP(S) network error

711 HTTP(S) URL error

712 HTTP(S) empty URL

713 HTTP(S) IP address error

714 HTTP(S) DNS error

715 HTTP(S) socket create error

716 HTTP(S) socket connect error

717 HTTP(S) socket read error

BG96_HTTP(S)_Application_Note 33 / 36
LPWA Module Series

718 HTTP(S) socket write error

719 HTTP(S) socket closed

720 HTTP(S) data encode error

721 HTTP(S) data decode error

722 HTTP(S) read timeout

723 HTTP(S) response failed

724 Incoming call busy

725 Voice call busy

726 Input timeout

727 Wait data timeout

728 Wait HTTP(S) response timeout

729 Memory allocation failed

730 Invalid parameter

BG96_HTTP(S)_Application_Note 34 / 36
LPWA Module Series

6 Summary of HTTP(S) Response Codes


<httprspcode> indicates the response codes from HTTP(S) server. The details about <httprspcode>
are described in the following table.

Table 3: Summary of HTTP(S) Response Codes

<httprspcode> Meaning

200 OK

403 Forbidden

404 Not found

409 Conflict

411 Length required

500 Internal server error

BG96_HTTP(S)_Application_Note 35 / 36
LPWA Module Series

7 Appendix References

Table 4: Related Documents

Document Name

[1] Quectel_BG96_TCP(IP)_Application_Note

[2] Quectel_BG96_AT_Commands_Manual

[3] Quectel_BG96_SSL_Application_Note

Table 5: Terms and Abbreviations

Abbreviation Description

DNS Domain Name Server

DTR Data Terminal Ready

HTTP Hyper Text Transport Protocol

HTTPS Hyper Text Transfer Protocol Secure

PPP Point-to-Point Protocol

SSL Security Socket Layer

URI Uniform Resource Identifier

URL Uniform Resource Locator

BG96_HTTP(S)_Application_Note 36 / 36

You might also like