Use Cases In Synchronous Mode With +Sqnhttp Commands - Renesas RYZ014 Manual

Hide thumbs Also See for RYZ014:
Table of Contents

Advertisement

RYZ014 Modules

6.4.2 Use Cases in Synchronous Mode with +SQNHTTP Commands

6.4.2.1 Send a GET Request
Command
Type this command to configure the HTTP connection without SSL enabled.
AT+SQNHTTPCFG=1,"httpbin.org",80,0,"","",0,120,1
AT+SQNHTTPCFG?
AT+SQNHTTPQRY=1,0,"/"
If succeed before timeout, you would get an URC. This means the file is found and length is 13011.
AT+SQNHTTPRCV=1,0
Then would get the file shown on the screen. This is ended by an "OK" in the last line.
6.4.2.2 Send POST Request with AT+SQNHTTPSND
This test is to be run after the GET request sequence.
Command
AT+SQNHTTPSND=1,0,"/post",7
Type string with additional parameter and press CTRL+Z
foo=bar
AT+SQNHTTPRCV=1,0
You would get the data, followed by an "OK" in a separated line.
6.4.2.3 Note on <post_param> and <extra-header-line> Parameter
In AT+SQNHTTPSND, the parameter <post_param> is optional. It is to be used only for POST request type
and is related to <Content-Type> in the HTTP header. In the example above, "0" default value is used.
HTTP packets include, in the header:
Content-Type: application/x-www-form-urlencoded
You might want to define charset for text/plain, or boundary for multipart/form-data. In these
cases, you need an extension as detailed below:
Set charset to us-ascii:
Set <post_param> to "1:charset=us-ascii", then the request will contain "Content-type: text/plain;
charset=us-ascii" header line.
AT+SQNHTTPSND=1,0,"/post",7,"1:charset=us-ascii"
Set boundary "—-WebKitFormBoundaryv9K2Q6NJOnI5kAZX"
R19AN0075EU0200 Rev.2.00
Aug.29.22
Response
Comment
OK
Read command of HTTP configuration
+SQNHTTPCFG: 0,"",80,0,"","",0,120,3
+SQNHTTPCFG: 1,"httpbin.org",80,0,"","",0,120,1
+SQNHTTPCFG: 2,"",80,0,"","",0,120,3
QRY command to query a test file.
OK
See below the note on
<extra-header-line> parameter.
+SQNHTTPRING: 0,200,"text/html; charset=utf-8",13011
RCV command to get it:
Note that SQNHTTPRCV returns error when there is no body (only a
(...)
header) in the data received.
OK
Response
Comment
Type the command. See below the notes on <post-param>
and
<extra-header-line> parameters.
>
Get a prompt
In case of success ,you will get the URC
OK
+SQNHTTPRING: 1,200,"application/json",258
Read the data received:
(...)
Note that SQNHTTPRCV returns error when there is no body
(only a header) in the data received.
OK
Use Cases with AT Commands
Page 34 of 67

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the RYZ014 and is the answer not in the manual?

Table of Contents