72 #ifndef SOL_NO_API_VERSION
73 #define SOL_HTTP_REQUEST_INTERFACE_API_VERSION (1)
struct sol_http_client_connection * pending
Definition: download.c:29
Handle for an HTTP response.
Definition: sol-http.h:248
struct sol_http_client_connection sol_http_client_connection
Opaque handler for an HTTP client connection.
Definition: sol-http-client.h:60
void sol_http_client_connection_cancel(struct sol_http_client_connection *pending)
Cancel a pending request and release its resources.
size_t data_buffer_size
The size in bytes of the receiving data buffer.
Definition: sol-http-client.h:139
uint16_t api_version
api_version must match SOL_HTTP_REQUEST_INTERFACE_API_VERSION at runtime.
Definition: sol-http-client.h:78
#define SOL_ATTR_WARN_UNUSED_RESULT
Causes a warning to be emitted if a caller of the function with this attribute does not use its retur...
Definition: sol-macros.h:187
void(* on_response)(void *user_data, struct sol_http_client_connection *connection, struct sol_http_response *response)
This callback is called when the request finishes, the result of request is available on response...
Definition: sol-http-client.h:131
struct sol_http_request_interface sol_http_request_interface
The HTTP request interface to use when creating a new request.
ssize_t(* on_send)(void *user_data, struct sol_http_client_connection *connection, struct sol_buffer *buffer)
This callback is called data should be written, it's commonly used for POST.
Definition: sol-http-client.h:118
sol_http_method
Type of HTTP method.
Definition: sol-http.h:47
Keep vector of HTTP parameters to be sent in a request.
Definition: sol-http.h:178
#define SOL_ATTR_NON_NULL(...)
Specifies that some function parameters should be non-null pointers.
Definition: sol-macros.h:193
struct sol_http_client_connection * sol_http_client_request_with_interface(enum sol_http_method method, const char *url, const struct sol_http_params *params, const struct sol_http_request_interface *interface, const void *data)
Create a request for the specified URL using the given method.
ssize_t(* on_data)(void *user_data, struct sol_http_client_connection *connection, const struct sol_buffer *buffer)
This callback is called whenever data comes.
Definition: sol-http-client.h:96
struct sol_http_client_connection * sol_http_client_request(enum sol_http_method method, const char *url, const struct sol_http_params *params, void(*cb)(void *data, struct sol_http_client_connection *connection, struct sol_http_response *response), const void *data)
Create a request for the specified URL using the given method.
The HTTP request interface to use when creating a new request.
Definition: sol-http-client.h:71
A sol_buffer is a dynamic array, that can be resized if needed.
Definition: sol-buffer.h:130