mirror of
https://github.com/espressif/esp-idf
synced 2025-03-12 10:39:11 -04:00
Merge branch 'feature/set_redirection' into 'master'
Add a `esp_http_client_set_redirection` function See merge request idf/esp-idf!4856
This commit is contained in:
commit
cf9f2aa466
@ -609,6 +609,17 @@ esp_err_t esp_http_client_cleanup(esp_http_client_handle_t client)
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
esp_err_t esp_http_client_set_redirection(esp_http_client_handle_t client)
|
||||||
|
{
|
||||||
|
if (client == NULL) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
if (client->location == NULL) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
return esp_http_client_set_url(client, client->location);
|
||||||
|
}
|
||||||
|
|
||||||
static esp_err_t esp_http_check_response(esp_http_client_handle_t client)
|
static esp_err_t esp_http_check_response(esp_http_client_handle_t client)
|
||||||
{
|
{
|
||||||
char *auth_header = NULL;
|
char *auth_header = NULL;
|
||||||
|
@ -406,6 +406,18 @@ esp_err_t esp_http_client_cleanup(esp_http_client_handle_t client);
|
|||||||
*/
|
*/
|
||||||
esp_http_client_transport_t esp_http_client_get_transport_type(esp_http_client_handle_t client);
|
esp_http_client_transport_t esp_http_client_get_transport_type(esp_http_client_handle_t client);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set redirection URL.
|
||||||
|
* When received the 30x code from the server, the client stores the redirect URL provided by the server.
|
||||||
|
* This function will set the current URL to redirect to enable client to execute the redirection request.
|
||||||
|
*
|
||||||
|
* @param[in] client The esp_http_client handle
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* - ESP_OK
|
||||||
|
* - ESP_FAIL
|
||||||
|
*/
|
||||||
|
esp_err_t esp_http_client_set_redirection(esp_http_client_handle_t client);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user