A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.espressif.com/projects/esp-at/en/latest/esp32/AT_Command_Set/HTTP_AT_Commands.html below:

Website Navigation


HTTP AT Commands - ESP32

HTTP AT Commands

[中文]

Introduction

Important

The default AT firmware supports all the AT commands mentioned on this page. If you don’t need ESP32 to support HTTP commands, you can compile the ESP-AT project by following the steps in Compile ESP-AT Project Locally documentation. In the project configuration during the fifth step, make the following selections:

AT+HTTPCLIENT: Send HTTP Client Request Set Command

Command:

AT+HTTPCLIENT=<opt>,<content-type>,<"url">,[<"host">],[<"path">],<transport_type>[,<"data">][,<"http_req_header">][,<"http_req_header">][...]

Response:

+HTTPCLIENT:<size>,<data>

OK
Parameters Notes Example
// HEAD Request
AT+HTTPCLIENT=1,0,"http://httpbin.org/get","httpbin.org","/get",1

// GET Request
AT+HTTPCLIENT=2,0,"http://httpbin.org/get","httpbin.org","/get",1

// POST Request
AT+HTTPCLIENT=3,0,"http://httpbin.org/post","httpbin.org","/post",1,"field1=value1&field2=value2"
AT+HTTPGETSIZE: Get HTTP Resource Size Set Command

Command:

AT+HTTPGETSIZE=<"url">[,<tx size>][,<rx size>][,<timeout>]

Response:

Parameters Note Example
AT+HTTPGETSIZE="http://www.baidu.com/img/bdlogo.gif"
AT+HTTPCGET: Get HTTP Resource Set Command

Command:

AT+HTTPCGET=<"url">[,<tx size>][,<rx size>][,<timeout>]

Response:

+HTTPCGET:<size>,<data>
OK
Parameters Note AT+HTTPCPOST: Post HTTP data of specified length Set Command

Command:

AT+HTTPCPOST=<"url">,<length>[,<http_req_header_cnt>][,<"http_req_header">..<"http_req_header">]

Response:

The symbol > indicates that AT is ready for receiving serial data, and you can enter the data now. When the requirement of message length determined by the parameter <length> is met, the transmission starts.

If the transmission is successful, AT returns:

Otherwise, it returns:

Parameters Note AT+HTTPCPUT: Put HTTP data of specified length Set Command

Command:

AT+HTTPCPUT=<"url">,<length>[,<http_req_header_cnt>][,<"http_req_header">..<"http_req_header">]

Response:

The symbol > indicates that AT is ready for receiving serial data, and you can enter the data now. When the requirement of message length determined by the parameter <length> is met, the transmission starts.

If the transmission is successful, AT returns:

Otherwise, it returns:

Parameters Note AT+HTTPURLCFG: Set/Get long HTTP URL Query Command

Command:

Response:

[+HTTPURLCFG:<url length>,<data>]
OK
Set Command

Command:

AT+HTTPURLCFG=<url length>

Response:

This response indicates that AT is ready for receiving serial data. You should enter the URL now, and when the URL length reaches the <url length> value, the system returns:

Parameters AT+HTTPCFG: Set HTTP Client Configuration Set Command

Command:

AT+HTTPCFG=<auth_mode>[,<pki_number>][,<ca_number>]

Response:

Parameters Notes HTTP AT Error Codes

When AT+SYSLOG=1 is enabled, if an HTTP client request fails, AT will return an error code. The error code format is:

Where 01 is the module identifier, 0a is the module’s response result to the executed AT command, and 7xxx represents an HTTP error code. If xxx falls within the range of standard HTTP status codes, it indicates a standard HTTP status code; otherwise, it indicates an internal error code specific to AT HTTP. The following table lists some common HTTP status codes. For more details, please refer to RFC 2616.

HTTP Error Code (HTTP Status Code)

Description

0x7000

Connection Failed

0x7190 (400)

Bad Request

0x7191 (401)

Unauthorized

0x7192 (402)

Payment Required

0x7193 (403)

Forbidden

0x7194 (404)

Not Found

0x7195 (405)

Method Not Allowed

0x7196 (406)

Not Acceptable

0x7197 (407)

Proxy Authentication Required

0x7198 (408)

Request Timeout

0x7199 (409)

Conflict

0x719a (410)

Gone

0x719b (411)

Length Required

0x719c (412)

Precondition Failed

0x719d (413)

Request Entity Too Large

0x719e (414)

Request-URI Too Long

0x719f (415)

Unsupported Media Type

0x71a0 (416)

Requested Range Not Satisfiable

0x71a1 (417)

Expectation Failed

0x71f4 (500)

Internal Server Error

0x71f5 (501)

Not Implemented

0x71f6 (502)

Bad Gateway

0x71f7 (503)

Service Unavailable

0x71f8 (504)

Gateway Timeout

0x71f9 (505)

HTTP Version Not Supported


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4