PingAccess Agent SDK for C
paa-http-client.h
Go to the documentation of this file.
1 /*****************************************************
2  * Copyright (C) 2015 Ping Identity Corporation
3  * All rights reserved.
4  *
5  * The contents of this file are the property of Ping Identity Corporation.
6  * You may not copy or use this file, in either source code or executable
7  * form, except in compliance with terms set by Ping Identity Corporation.
8  * For further information please contact:
9  *
10  * Ping Identity Corporation
11  * 1001 17th St Suite 100
12  * Denver, CO 80202
13  * 303.468.2900
14  * http://www.pingidentity.com
15  *
16  ****************************************************/
17 
29 #ifndef _PAA_SDK_HTTP_CLIENT_H_
30 #define _PAA_SDK_HTTP_CLIENT_H_ 1
31 
32 #include <stdlib.h>
33 
34 #include "apr.h"
35 #include "apr_pools.h"
36 
37 #include "paa-http-server-facade.h"
38 #include "paa-util.h"
39 
41 #define APR_PAA_HTTP_ERROR (APR_PAA_HTTP_START + 0)
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
49 
55 {
57  void *impl;
58 
70  apr_status_t (*add_request_header)(const paa_http_request *req,
71  const char *name,
72  const char *value);
73 
83  apr_status_t (*set_request_uri)(const paa_http_request *req,
84  const char *uri);
85 
95  apr_status_t (*set_request_method)(const paa_http_request *req,
96  const char *method);
97 
110  int include_body);
111 };
112 
121 typedef void (*paa_resp_status_cb)(unsigned int status,
122  const char *reason,
123  void *userdata);
124 
134 typedef void (*paa_resp_header_cb)(const char *name,
135  const char *value,
136  void *userdata);
137 
151 typedef size_t (*paa_resp_body_cb)(const unsigned char *src,
152  size_t size,
153  void *userdata);
154 
157 
163 {
165  void *impl;
166 
179  apr_status_t (*process_status)(const paa_http_response *response,
181  void *userdata);
182 
194  apr_status_t (*process_headers)(const paa_http_response *response,
196  void *userdata);
197 
208  apr_status_t (*remove_header)(const paa_http_response *response,
209  const char *name);
210 
228  apr_status_t (*register_body_callback)(const paa_http_response *response,
229  paa_resp_body_cb cb,
230  void *userdata);
231 };
232 
235 
241 {
243  void *impl;
244 
258  apr_status_t (*create_request_handle)(const paa_http_context *context,
259  const paa_http_request **request);
260 
267  void (*set_resp_pool)(const paa_http_context *context,
268  apr_pool_t *resp_pool);
269 
276  void (*set_resp_status_cb)(const paa_http_context *context,
277  paa_resp_status_cb cb);
278 
285  void (*set_resp_header_cb)(const paa_http_context *context,
286  paa_resp_header_cb cb);
287 
298  void (*set_resp_body_cb)(const paa_http_context *context,
299  paa_resp_body_cb cb);
300 
307  void (*set_resp_userdata)(const paa_http_context *context,
308  void *userdata);
309 
330  apr_status_t (*send_request)(const paa_http_context *context,
331  const paa_client_request *client_request);
332 };
333 
336 
341 {
343  void *impl;
344 
358  apr_status_t (*create_context)(const paa_http_client *client,
359  apr_pool_t *pool,
360  const paa_http_context **context);
361 };
362 
363 #ifdef __cplusplus
364 } /* C */
365 #endif
366 
367 #endif /* _PAA_SDK_HTTP_CLIENT_H_ */
Definition: paa-http-client.h:340
void(* paa_resp_header_cb)(const char *name, const char *value, void *userdata)
Definition: paa-http-client.h:134
void * impl
Definition: paa-http-client.h:165
Definition: paa-http-client.h:162
void * impl
Definition: paa-http-client.h:343
void * impl
Definition: paa-http-client.h:57
size_t(* paa_resp_body_cb)(const unsigned char *src, size_t size, void *userdata)
Definition: paa-http-client.h:151
Definition: paa-http-server-facade.h:92
apr_status_t(* add_request_header)(const paa_http_request *req, const char *name, const char *value)
Definition: paa-http-client.h:70
apr_status_t(* set_request_uri)(const paa_http_request *req, const char *uri)
Definition: paa-http-client.h:83
void(* paa_resp_status_cb)(unsigned int status, const char *reason, void *userdata)
Definition: paa-http-client.h:121
void * impl
Definition: paa-http-client.h:243
apr_status_t(* set_request_method)(const paa_http_request *req, const char *method)
Definition: paa-http-client.h:95
Definition: paa-http-client.h:240
Definition: paa-http-client.h:54
apr_status_t(* set_include_client_request_body)(const paa_http_request *req, int include_body)
Definition: paa-http-client.h:109