mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'feature/backport_v4.4_add_get_errno_api_for_http_client' into 'release/v4.4'
esp_http_client: add a get HTTP client session errno API for esp_http_client(backport v4.4) See merge request espressif/esp-idf!16195
This commit is contained in:
commit
376514480d
@ -905,6 +905,15 @@ esp_err_t esp_http_client_set_url(esp_http_client_handle_t client, const char *u
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
int esp_http_client_get_errno(esp_http_client_handle_t client)
|
||||
{
|
||||
if (!client) {
|
||||
ESP_LOGE(TAG, "Invalid client handle");
|
||||
return -1;
|
||||
}
|
||||
return esp_transport_get_errno(client->transport);
|
||||
}
|
||||
|
||||
esp_err_t esp_http_client_set_method(esp_http_client_handle_t client, esp_http_client_method_t method)
|
||||
{
|
||||
client->connection_info.method = method;
|
||||
|
@ -344,6 +344,17 @@ esp_err_t esp_http_client_set_password(esp_http_client_handle_t client, const ch
|
||||
*/
|
||||
esp_err_t esp_http_client_set_authtype(esp_http_client_handle_t client, esp_http_client_auth_type_t auth_type);
|
||||
|
||||
/**
|
||||
* @brief Get HTTP client session errno
|
||||
*
|
||||
* @param[in] client The esp_http_client handle
|
||||
*
|
||||
* @return
|
||||
* - (-1) if invalid argument
|
||||
* - errno
|
||||
*/
|
||||
int esp_http_client_get_errno(esp_http_client_handle_t client);
|
||||
|
||||
/**
|
||||
* @brief Set http request method
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user