|
Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
|
Multiprotocol HTTP client API. More...
#include <zephyr/kernel.h>#include <zephyr/net/http/frame.h>#include <zephyr/net/http/hpack.h>#include <zephyr/net/http/method.h>#include <zephyr/net/net_ip.h>#include <zephyr/net/tls_credentials.h>#include <zephyr/net/http/status.h>Go to the source code of this file.
Data Structures | |
| struct | http_client_header |
| An HTTP header field, a name and value pair. More... | |
| struct | http_client_transport_ops |
| HTTP transport API. More... | |
| struct | http_client_transport_tcp_ctx |
| TCP transport context for the HTTP client. More... | |
| struct | http_client_transport_tls_config |
| TLS configuration for the HTTP client. More... | |
| struct | http_client_transport_tls_ctx |
| TLS transport context for the HTTP client. More... | |
| struct | http_client_response |
| HTTP response context. More... | |
| struct | http_client_request |
| HTTP request context. More... | |
| struct | http_client_stream |
| HTTP stream context. More... | |
| struct | http_client_session |
| HTTP session context. More... | |
| struct | http_client_session_config |
| HTTP session configuration. More... | |
| struct | http_client |
| HTTP client context. More... | |
Typedefs | |
| typedef int(* | http_client_socket_create_cb_t) (struct http_client *client, int af, int proto) |
| A function to offload socket creation for the transport layer. | |
| typedef int(* | http_client_payload_cb_t) (size_t offset, const uint8_t **payload, size_t *len, bool *more, void *user_data) |
| Callback for providing payload for the HTTP request. | |
| typedef int(* | http_client_headers_cb_t) (const struct http_client_header **headers, size_t *count, bool *more, void *user_data) |
| Callback for providing additional headers for the HTTP request. | |
| typedef int(* | http_client_response_cb_t) (struct http_client *client, const struct http_client_request *request, struct http_client_response *response, enum http_client_transaction_status status, void *user_data) |
| Callback used when data is received from the server or an error occurred. | |
Enumerations | |
| enum | http_client_version { HTTP_CLIENT_VERSION_1_1 , HTTP_CLIENT_VERSION_2 , HTTP_CLIENT_VERSION_3 } |
| HTTP protocol version. More... | |
| enum | http_client_transaction_status { HTTP_CLIENT_TRANSACTION_ABORTED = -1 , HTTP_CLIENT_RESPONSE_DATA_MORE = 0 , HTTP_CLIENT_RESPONSE_DATA_FINAL = 1 } |
| State of the HTTP exchange passed to the callback. More... | |
| enum | http_client_session_state { HTTP_CLIENT_SESSION_CLOSED , HTTP_CLIENT_SESSION_OPEN , HTTP_CLIENT_SESSION_CLOSING } |
| HTTP client session state. More... | |
Functions | |
| void | http_client_received_data (struct http_client *client, int status) |
| Notify HTTP client about a transport reception event. | |
| int | http_client_init (struct http_client *client, enum http_client_version version, const struct http_client_transport_ops *transport_ops, void *transport_ctx) |
| Initialize HTTP client with a custom transport. | |
| int | http_client_init_tcp (struct http_client *client, enum http_client_version version, struct http_client_transport_tcp_ctx *transport_ctx) |
| Initialize HTTP client with TCP transport. | |
| int | http_client_init_tls (struct http_client *client, enum http_client_version version, struct http_client_transport_tls_ctx *transport_ctx) |
| Initialize HTTP client with TLS transport. | |
| int | http_client_connect (struct http_client *client, struct http_client_session_config *config) |
| Connect HTTP client to a HTTP server. | |
| int | http_client_send_request (struct http_client *client, const struct http_client_request *request, int32_t timeout, void *user_data) |
| Send HTTP request to a HTTP server. | |
| int | http_client_disconnect (struct http_client *client) |
| Disconnect HTTP client from a HTTP server. | |
Multiprotocol HTTP client API.
An API for applications to send HTTP requests.