mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-02 05:20:59 +02:00
IDF release/v3.3 (#3339)
* IDF release/v3.3 46b12a560 * fix build * IDF release/v3.3 367c3c09c
This commit is contained in:
@ -118,8 +118,20 @@ typedef struct {
|
||||
void *user_data; /*!< HTTP user_data context */
|
||||
bool is_async; /*!< Set asynchronous mode, only supported with HTTPS for now */
|
||||
bool use_global_ca_store; /*!< Use a global ca_store for all the connections in which this bool is set. */
|
||||
bool skip_cert_common_name_check; /*!< Skip any validation of server certificate CN field */
|
||||
} esp_http_client_config_t;
|
||||
|
||||
/**
|
||||
* Enum for the HTTP status codes.
|
||||
*/
|
||||
typedef enum {
|
||||
/* 3xx - Redirection */
|
||||
HttpStatus_MovedPermanently = 301,
|
||||
HttpStatus_Found = 302,
|
||||
|
||||
/* 4xx - Client Error */
|
||||
HttpStatus_Unauthorized = 401
|
||||
} HttpStatus_Code;
|
||||
|
||||
#define ESP_ERR_HTTP_BASE (0x7000) /*!< Starting number of HTTP error codes */
|
||||
#define ESP_ERR_HTTP_MAX_REDIRECT (ESP_ERR_HTTP_BASE + 1) /*!< The error exceeds the number of HTTP redirects */
|
||||
@ -235,13 +247,71 @@ esp_err_t esp_http_client_set_header(esp_http_client_handle_t client, const char
|
||||
*/
|
||||
esp_err_t esp_http_client_get_header(esp_http_client_handle_t client, const char *key, char **value);
|
||||
|
||||
/**
|
||||
* @brief Get http request username.
|
||||
* The address of username buffer will be assigned to value parameter.
|
||||
* This function must be called after `esp_http_client_init`.
|
||||
*
|
||||
* @param[in] client The esp_http_client handle
|
||||
* @param[out] value The username value
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK
|
||||
* - ESP_ERR_INVALID_ARG
|
||||
*/
|
||||
esp_err_t esp_http_client_get_username(esp_http_client_handle_t client, char **value);
|
||||
|
||||
/**
|
||||
* @brief Set http request username.
|
||||
* The value of username parameter will be assigned to username buffer.
|
||||
* If the username parameter is NULL then username buffer will be freed.
|
||||
*
|
||||
* @param[in] client The esp_http_client handle
|
||||
* @param[in] username The username value
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK
|
||||
* - ESP_ERR_INVALID_ARG
|
||||
*/
|
||||
esp_err_t esp_http_client_set_username(esp_http_client_handle_t client, const char *username);
|
||||
|
||||
/**
|
||||
* @brief Get http request password.
|
||||
* The address of password buffer will be assigned to value parameter.
|
||||
* This function must be called after `esp_http_client_init`.
|
||||
*
|
||||
* @param[in] client The esp_http_client handle
|
||||
* @param[out] value The password value
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK
|
||||
* - ESP_ERR_INVALID_ARG
|
||||
*/
|
||||
esp_err_t esp_http_client_get_password(esp_http_client_handle_t client, char **value);
|
||||
|
||||
/**
|
||||
* @brief Set http request password.
|
||||
* The value of password parameter will be assigned to password buffer.
|
||||
* If the password parameter is NULL then password buffer will be freed.
|
||||
*
|
||||
* @param[in] client The esp_http_client handle
|
||||
* @param[in] password The password value
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK
|
||||
* - ESP_ERR_INVALID_ARG
|
||||
*/
|
||||
esp_err_t esp_http_client_set_password(esp_http_client_handle_t client, char *password);
|
||||
|
||||
/**
|
||||
* @brief Set http request method
|
||||
*
|
||||
* @param[in] client The esp_http_client handle
|
||||
* @param[in] method The method
|
||||
*
|
||||
* @return ESP_OK
|
||||
* @return
|
||||
* - ESP_OK
|
||||
* - ESP_ERR_INVALID_ARG
|
||||
*/
|
||||
esp_err_t esp_http_client_set_method(esp_http_client_handle_t client, esp_http_client_method_t method);
|
||||
|
||||
@ -383,12 +453,23 @@ esp_http_client_transport_t esp_http_client_get_transport_type(esp_http_client_h
|
||||
*
|
||||
* @param[in] client The esp_http_client handle
|
||||
*
|
||||
* @return
|
||||
* @return
|
||||
* - ESP_OK
|
||||
* - ESP_FAIL
|
||||
*/
|
||||
esp_err_t esp_http_client_set_redirection(esp_http_client_handle_t client);
|
||||
|
||||
/**
|
||||
* @brief On receiving HTTP Status code 401, this API can be invoked to add authorization
|
||||
* information.
|
||||
*
|
||||
* @note There is a possibility of receiving body message with redirection status codes, thus make sure
|
||||
* to flush off body data after calling this API.
|
||||
*
|
||||
* @param[in] client The esp_http_client handle
|
||||
*/
|
||||
void esp_http_client_add_auth(esp_http_client_handle_t client);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user