Merge branch 'feature/add_get_errno_api_for_http_client' into 'master'

esp_http_client: add a get HTTP client session errno API for esp_http_client

See merge request espressif/esp-idf!15869
pull/7966/head
Mahavir Jain 2021-11-24 11:25:04 +00:00
commit ec9b69d7e3
2 zmienionych plików z 20 dodań i 0 usunięć

Wyświetl plik

@ -904,6 +904,15 @@ error:
return ret;
}
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;

Wyświetl plik

@ -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
*