HTTP AT command set ================================================== This chapter introduces the driver HTTP instruction set. This instruction set will be adapted differently for different modules. For specific differences, please move to::doc:`../instruction/other/firmware_differences`. - :ref:`AT+HTTPCLIENTLIN `:Send HTTP/HTTPS request (single-line mode) - :ref:`AT+HTTPRAW `:Send an HTTP/HTTPS long text POST request .. _cmd-HTTPCLIENTLIN: AT+HTTPCLIENTLIN:Send HTTP client request ------------------------------------------ Execute command ^^^^^^^^ **Command:** :: AT+HTTPCLIENTLINE=,,,,,[,] **Response:** :: Response length: //response body Data length //Response data obtained OK Parameters ^^^^ - ****:request protocol - 1:HTTP - 2:HTTPS - ****:request type. - 2:GET - 3:POST - ****:Request data type. (Only valid for POST, not valid for GET, you can fill in any string, the reference type is as follows) - application/x-www-form-urlencoded - application/json - multipart/form-data - text/xml - text/html - ****:Server domain name or IP. - eg:www.baidu.com or 192.168.1.100。 - ****:The port number. - HTTP default value 80,HTTPS default value 443. - ****: HTTP(S)path. - default value"/" - ****: Data carried by the request. - 1:When opt is GET, this is carried in the patch, and the format meets the http format requirements(?key1=value1&key2=value2 ...) - 2:When opt is POST, this is the body carried by POST. Description ^^^^ - Make an HTTP request. Example ^^^^ :: //GET request AT+HTTTPCLIENTLINE=1,2,"application/x-www-form-urlencoded","httpbin.org",80,"/get?key1=123&key2=456" //POST request AT+HTTTPCLIENTLINE=1,3,"application/json","httpbin.org",80,"/post",{"key1": 123} .. _cmd-HTTPRAW: AT+HTTPRAW:Send an HTTP client POST (with long text) request ------------------------------------------ executive command ^^^^^^^^ **command:** :: AT+HTTPRAW=,,,,,,len **response:** :: > //After receiving this character, enter the data to be sent OK //After receiving this character, start to enter the data to be sent. When the corresponding byte data is received, the data will be sent (can be any number). When the corresponding byte data is received, the data will be sent (can be any data) parameter ^^^^ - ****:Request protocol. - 1:HTTP - 2:HTTPS - ****:request type. - 3:POST - ****:Request data type. (Only POST takes effect, GET does not take effect, you can fill in any string, the reference type is as follows). - application/x-www-form-urlencoded - application/json - multipart/form-data - text/xml - text/html - ****:Domain name or IP address of the server. - eg:www.baidu.com or 192.168.1.100. - ****:port number. - HTTP default value 80,HTTPS default value 443. - ****: HTTP(S)path. - default value"/". - ****: Request to carry data. - Request data length. explain ^^^^ - Initiates an HTTP request. example ^^^^ :: AT+HTTPRAW=1,3,"application/json","httpbin.org",80,"/post",13 >{"key1": 123}