Chapter 4. Software framework
(continued from previous page)
ESP_LOGI(TAG, "content_length: %d, status_code: %d", content_length, esp_
,→http_client_get_status_code(client));
int read_len = esp_http_client_read(client, buffer, 1024);
ESP_LOGI(TAG, "receive %d data from server: %s", read_len, buffer);
esp_http_client_close(client);
esp_http_client_cleanup(client);
}
Is there a way to set cookies when ESP32 operates as an HTTP client?
ESP32 itself does not have an API for setting cookies directly, but you can use
esp_http_client_set_header to add cookies to the HTTP header.
How do I set the maximum number of clients that are allowed for connection when ESP32 serves as an HTTP
server? What will happen if the number exceeds the limit?
• The maximum number of client connections can be set by conguring max_open_sockets in the
httpd_config_t
structure.
• If the number of clients exceeds the limit, you can set the lru_purge_enable parameter in the
httpd_config_t structure to true. In doing so, if there is no socket available (which is determined by
max_open_sockets), the least used socket will be cleared to accept the coming one.
Does ESP32 have an example of implementing a gRPC client over HTTP/2 and above versions?
Not yet.
How to download a specic segment of a le over HTTP in ESP-IDF (i.e., add Range:bytes information
to the header)?
Please refer to the http_partial_download function in the esp http client example.
4.5.3 lwIP
How soon can the associated resources be released after the TCP connection is closed?
The associated resources can be released in 2 MSL, i.e. 120 seconds, or after the sent linger/
send_timeout parameter is timeout.
Espressif Systems 92
Submit Document Feedback
Release master