PingAccess Agent SDK for C
Classes | Macros | Typedefs
paa-http-client.h File Reference
#include <stdlib.h>
#include "apr.h"
#include "apr_pools.h"
#include "paa-http-server-facade.h"
#include "paa-util.h"

Go to the source code of this file.

Classes

struct  paa_http_request_struct
 
struct  paa_http_response_struct
 
struct  paa_http_context_struct
 
struct  paa_http_client_struct
 

Macros

#define APR_PAA_HTTP_ERROR   (APR_PAA_HTTP_START + 0)
 

Typedefs

typedef struct paa_http_request_struct paa_http_request
 
typedef void(* paa_resp_status_cb) (unsigned int status, const char *reason, void *userdata)
 
typedef void(* paa_resp_header_cb) (const char *name, const char *value, void *userdata)
 
typedef size_t(* paa_resp_body_cb) (const unsigned char *src, size_t size, void *userdata)
 
typedef struct paa_http_response_struct paa_http_response
 
typedef struct paa_http_context_struct paa_http_context
 
typedef struct paa_http_client_struct paa_http_client
 

Detailed Description

Header for the HTTP client

HTTP client interface functions can return APR_PAA_HTTP_ERROR to indicate there was error in the underlying HTTP library. Since the underlying HTTP library likely has numerous error conditions, a standard approach for dealing with this situation is to log the specific error condition and return the generic APR_PAA_HTTP_ERROR to the caller.

Macro Definition Documentation

#define APR_PAA_HTTP_ERROR   (APR_PAA_HTTP_START + 0)

indicates an error occurred sending a request to PingAccess

Typedef Documentation

forward declaration for paa_http_client

forward declaration for paa_http_context

forward declaration for paa_http_request

forward declaration for paa_http_response

typedef size_t(* paa_resp_body_cb) (const unsigned char *src, size_t size, void *userdata)

Defines a callback for response body data. This callback can expect the data to be in the same format that it would appear on the wire. For example, if the response uses a chunked transfer-encoding, the data passed to this callback would already be in the chunked transfer-encoding.

Parameters
srcthe data
sizethe size of the data. A size of 0 should be used to indicate the end of the body.
Returns
the number of bytes actual consumed. A value less than size indicates an error condition.
typedef void(* paa_resp_header_cb) (const char *name, const char *value, void *userdata)

Defines a callback for response header data. Callers do not need to worry about combining multiple headers with the same name into one distinct header.

Parameters
namethe name of the header
valuethe value of the header
userdatacontext data for the callback
typedef void(* paa_resp_status_cb) (unsigned int status, const char *reason, void *userdata)

Defines a callback for response status data.

Parameters
statusthe status of the response
reasonthe reason string from the response. This data should be allocated in the response memory pool.
userdatacontext data for the callback