mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'feature/support_api_set_http_timeout' into 'master'
esp_http_client: Add API to set http client timeout value Closes IDFGH-5211 See merge request espressif/esp-idf!13446
This commit is contained in:
commit
5aa6e4196c
@ -906,6 +906,16 @@ esp_err_t esp_http_client_set_method(esp_http_client_handle_t client, esp_http_c
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t esp_http_client_set_timeout_ms(esp_http_client_handle_t client, int timeout_ms)
|
||||
{
|
||||
if (client == NULL) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
client->timeout_ms = timeout_ms;
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static int esp_http_client_get_data(esp_http_client_handle_t client)
|
||||
{
|
||||
if (client->state < HTTP_STATE_RES_COMPLETE_HEADER) {
|
||||
|
@ -360,6 +360,18 @@ esp_err_t esp_http_client_set_authtype(esp_http_client_handle_t client, esp_http
|
||||
*/
|
||||
esp_err_t esp_http_client_set_method(esp_http_client_handle_t client, esp_http_client_method_t method);
|
||||
|
||||
/**
|
||||
* @brief Set http request timeout
|
||||
*
|
||||
* @param[in] client The esp_http_client handle
|
||||
* @param[in] timeout_ms The timeout value
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK
|
||||
* - ESP_ERR_INVALID_ARG
|
||||
*/
|
||||
esp_err_t esp_http_client_set_timeout_ms(esp_http_client_handle_t client, int timeout_ms);
|
||||
|
||||
/**
|
||||
* @brief Delete http request header
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user