10#ifndef KEEL_REDIRECT_H
11#define KEEL_REDIRECT_H
23#define KL_REDIRECT_DEFAULT_MAX 10
44 const char *method,
const char *url,
46 const char *body,
size_t body_len,
55 const char *method,
const char *url,
57 const char *body,
size_t body_len,
76 const char *method,
const char *url,
78 const char *body,
size_t body_len,
89 const char *method,
const char *url,
91 const char *body,
size_t body_len,
HTTP/1.1 client (sync + async).
HTTP client connection pool.
KlError
Diagnostic error codes for Keel public functions.
Definition error.h:11
KlError kl_redirect_last_error(const KlRedirectClient *rc)
Get the specific error code from a completed redirect request.
void kl_redirect_free(KlRedirectClient *rc)
Free all redirect client resources.
struct KlRedirectClient KlRedirectClient
Definition redirect.h:62
int kl_redirect_error(const KlRedirectClient *rc)
Check if the redirect request completed with an error.
KlRedirectClient * kl_redirect_start_pooled(KlClientPool *pool, KlEventCtx *ev_ctx, KlAllocator *alloc, const KlClientConfig *cfg, const KlRedirectConfig *redir, const char *method, const char *url, const KlClientHeader *headers, int num_headers, const char *body, size_t body_len, KlRedirectDoneFn on_done, void *user_data)
Start an asynchronous pooled HTTP request with redirect following.
int kl_redirect_request(KlAllocator *alloc, const KlClientConfig *cfg, const KlRedirectConfig *redir, const char *method, const char *url, const KlClientHeader *headers, int num_headers, const char *body, size_t body_len, KlClientResponse *resp)
Synchronous HTTP request with automatic redirect following.
const KlClientResponse * kl_redirect_response(const KlRedirectClient *rc)
Get the final response from a completed redirect client.
void kl_redirect_cancel(KlRedirectClient *rc)
Cancel an in-flight redirect request.
KlRedirectClient * kl_redirect_start(KlEventCtx *ev_ctx, KlAllocator *alloc, const KlClientConfig *cfg, const KlRedirectConfig *redir, const char *method, const char *url, const KlClientHeader *headers, int num_headers, const char *body, size_t body_len, KlRedirectDoneFn on_done, void *user_data)
Start an asynchronous HTTP request with automatic redirect following.
int kl_redirect_request_pooled(KlClientPool *pool, KlAllocator *alloc, const KlClientConfig *cfg, const KlRedirectConfig *redir, const char *method, const char *url, const KlClientHeader *headers, int num_headers, const char *body, size_t body_len, KlClientResponse *resp)
Synchronous pooled HTTP request with automatic redirect following.
void(* KlRedirectDoneFn)(KlRedirectClient *rc, void *user_data)
Callback invoked when an async redirect-following request completes.
Definition redirect.h:67
Bring-your-own allocator vtable.
Definition allocator.h:12
Definition client_pool.h:71
Composable event loop context.
Definition event_ctx.h:42
int max_redirects
Definition redirect.h:28