12#define FETCH_HEADERS_COUNT_MAX (12)
FetchStatus fetch_run(Fetch *instance, const FetchRequest *request)
Run the fetch process in the current thread.
Definition fetch.c:361
void(* FetchProgressCallback)(const FetchProgress *progress, void *context)
Progress reporting callback function type.
Definition fetch.h:88
void(* FetchHeaderCallback)(const void *data, size_t data_size, void *context)
Received HTTP headers callback function type.
Definition fetch.h:80
Fetch * fetch_alloc(void)
Create a Fetch instance.
Definition fetch.c:349
void fetch_set_progress_callback(Fetch *instance, FetchProgressCallback callback)
Sets the callback for status updates.
Definition fetch.c:452
void fetch_set_callback_context(Fetch *instance, void *context)
Set the callback context for the Fetch instance.
Definition fetch.c:432
void fetch_free(Fetch *instance)
Delete the Fetch instance.
Definition fetch.c:354
void fetch_set_rx_data_callback(Fetch *instance, FetchRxDataCallback callback)
Set the callback for received data.
Definition fetch.c:437
void(* FetchErrorCallback)(const char *error, void *context)
Error reporting callback function type.
Definition fetch.h:96
void fetch_set_error_callback(Fetch *instance, FetchErrorCallback callback)
Set the callback for error reporting.
Definition fetch.c:447
#define FETCH_HEADERS_COUNT_MAX
Maximum number of additional request headers.
Definition fetch.h:12
void fetch_set_header_callback(Fetch *instance, FetchHeaderCallback callback)
Set the callback for the header data.
Definition fetch.c:442
void fetch_stop(Fetch *instance)
Request the ongoing fetch process to stop.
Definition fetch.c:427
void(* FetchRxDataCallback)(const void *data, size_t data_size, void *context)
Received HTTP data callback function type.
Definition fetch.h:71
Common definitions for Fetch and files that use it.
FetchStatus
Enumeration of possible Fetch completion statuses.
Definition fetch_common.h:30
Fetch download progress structure.
Definition fetch_common.h:20
Request body structure.
Definition fetch.h:40
uint32_t length
Length of the data to be sent, in bytes.
Definition fetch.h:42
const void * data
Pointer to the data to be sent.
Definition fetch.h:41
Request structure.
Definition fetch.h:50
const char * url
Pointer to the remote URL string.
Definition fetch.h:57
TlsConfig tls_config
TLS configuration (optional).
Definition fetch.h:61
FetchRequestHeaders headers
Request headers (optional).
Definition fetch.h:59
const char * method
Pointer to the HTTP method string.
Definition fetch.h:58
FetchRequestBody body
Request body (optional).
Definition fetch.h:60
TLS configuration structure.
Definition tls_config.h:47
TLS configuration data structure.