EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #591 background imageLoading...
Page #591 background image
Chapter 2. API Reference
ESP_ERR_INVALID_ARG : Null request pointer
ESP_ERR_HTTPD_RESP_HDR : Essential headers are too large for internal buffer
ESP_ERR_HTTPD_RESP_SEND : Error in raw send
ESP_ERR_HTTPD_INVALID_REQ : Invalid request
Parameters
[in] r: The request being responded to
[in] str: String to be sent as response body
static esp_err_t httpd_resp_sendstr_chunk(httpd_req_t *r, const char *str)
API to send a string as an HTTP response chunk.
This API simply calls http_resp_send_chunk with buffer length set to string length assuming the buffer contains
a null terminated string
Return
ESP_OK : On successfully sending the response packet
ESP_ERR_INVALID_ARG : Null request pointer
ESP_ERR_HTTPD_RESP_HDR : Essential headers are too large for internal buffer
ESP_ERR_HTTPD_RESP_SEND : Error in raw send
ESP_ERR_HTTPD_INVALID_REQ : Invalid request
Parameters
[in] r: The request being responded to
[in] str: String to be sent as response body (NULL to finish response packet)
esp_err_t httpd_resp_set_status(httpd_req_t *r, const char *status)
API to set the HTTP status code.
This API sets the status of the HTTP response to the value specied. By default, the 200 OKresponse is
sent as the response.
Note
This API is supposed to be called only from the context of a URI handler where httpd_req_t* request
pointer is valid.
This API only sets the status to this value. The status isnt sent out until any of the send APIs is
executed.
Make sure that the lifetime of the status string is valid till send function is called.
Return
ESP_OK : On success
ESP_ERR_INVALID_ARG : Null arguments
ESP_ERR_HTTPD_INVALID_REQ : Invalid request pointer
Parameters
[in] r: The request being responded to
[in] status: The HTTP status code of this response
esp_err_t httpd_resp_set_type(httpd_req_t *r, const char *type)
API to set the HTTP content type.
This API sets the Content Typefield of the response. The default content type is text/html.
Note
This API is supposed to be called only from the context of a URI handler where httpd_req_t* request
pointer is valid.
This API only sets the content type to this value. The type isnt sent out until any of the send APIs
is executed.
Make sure that the lifetime of the type string is valid till send function is called.
Return
ESP_OK : On success
ESP_ERR_INVALID_ARG : Null arguments
ESP_ERR_HTTPD_INVALID_REQ : Invalid request pointer
Parameters
[in] r: The request being responded to
[in] type: The Content Type of the response
Espressif Systems 580
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish