PingAccess Agent SDK for C
|
#include <paa-http-client.h>
Public Attributes | |
void * | impl |
apr_status_t(* | create_request_handle )(const paa_http_context *context, const paa_http_request **request) |
void(* | set_resp_pool )(const paa_http_context *context, apr_pool_t *resp_pool) |
void(* | set_resp_status_cb )(const paa_http_context *context, paa_resp_status_cb cb) |
void(* | set_resp_header_cb )(const paa_http_context *context, paa_resp_header_cb cb) |
void(* | set_resp_body_cb )(const paa_http_context *context, paa_resp_body_cb cb) |
void(* | set_resp_userdata )(const paa_http_context *context, void *userdata) |
apr_status_t(* | send_request )(const paa_http_context *context, const paa_client_request *client_request) |
Interface for obtaining a request handle and registering callbacks for processing a response
apr_status_t(* paa_http_context_struct::create_request_handle) (const paa_http_context *context, const paa_http_request **request) |
Creates a new paa_http_request, managed by this context.
The context is only required to manage a single request at a time. That is, only the request returned by the most recent call to this function should be considered valid for use.
context | the context handle |
request | the output handle – populated on success |
void* paa_http_context_struct::impl |
opaque implementation handle
apr_status_t(* paa_http_context_struct::send_request) (const paa_http_context *context, const paa_client_request *client_request) |
Synchronously sends the request as configured via the request handle returned by create_request_handle. The response callbacks will be invoked as the response is received.
Implementations are free to retry requests on failures, as dictated by the semantics of the request being sent. As such, consumers should be prepared to have callbacks invoked for partial responses. Implementations must ensure that the callbacks are invoked in the order: status, headers, body. A simple way for consumers to account for this behavior is to initialize or reset any state for the response in the status callback as that will always be the first callback invoked for a response.
send_handle | the send handle |
client_request | the handle to the client request. |
void(* paa_http_context_struct::set_resp_body_cb) (const paa_http_context *context, paa_resp_body_cb cb) |
Sets the response body callback. This callback will always be invoked even for an empty response body.
The callback should be invoked with a size of 0 when the body is complete.
context | the context handle |
cb | the callback |
void(* paa_http_context_struct::set_resp_header_cb) (const paa_http_context *context, paa_resp_header_cb cb) |
Sets the response header callback
context | the context handle |
cb | the callback |
void(* paa_http_context_struct::set_resp_pool) (const paa_http_context *context, apr_pool_t *resp_pool) |
Sets the pool in which data should be allocated for response data
context | the context handle |
resp_pool | the pool in which to allocate response data |
void(* paa_http_context_struct::set_resp_status_cb) (const paa_http_context *context, paa_resp_status_cb cb) |
Sets the response status callback
context | the context handle |
cb | the callback |
void(* paa_http_context_struct::set_resp_userdata) (const paa_http_context *context, void *userdata) |
Sets the handle passed to response callbacks
send_handle | the send handle |
userdata | the handle that will be passed to response callbacks |