27 #ifndef _EVENT2_HTTP_H_
28 #define _EVENT2_HTTP_H_
54 #define HTTP_NOCONTENT 204
55 #define HTTP_MOVEPERM 301
56 #define HTTP_MOVETEMP 302
57 #define HTTP_NOTMODIFIED 304
58 #define HTTP_BADREQUEST 400
59 #define HTTP_NOTFOUND 404
60 #define HTTP_BADMETHOD 405
61 #define HTTP_ENTITYTOOLARGE 413
62 #define HTTP_EXPECTATIONFAILED 417
63 #define HTTP_INTERNAL 500
64 #define HTTP_NOTIMPLEMENTED 501
65 #define HTTP_SERVUNAVAIL 503
68 struct evhttp_request;
70 struct evhttp_bound_socket;
71 struct evconnlistener;
144 struct evhttp_bound_socket *
evhttp_bind_listener(
struct evhttp *http,
struct evconnlistener *listener);
217 void (*cb)(
struct evhttp_request *,
void *),
void *cb_arg);
234 void (*cb)(
struct evhttp_request *,
void *),
void *arg);
259 struct evhttp* vhost);
325 const char *reason,
struct evbuffer *databuf);
378 EVHTTP_REQ_GET = 1 << 0,
379 EVHTTP_REQ_POST = 1 << 1,
380 EVHTTP_REQ_HEAD = 1 << 2,
381 EVHTTP_REQ_PUT = 1 << 3,
382 EVHTTP_REQ_DELETE = 1 << 4,
383 EVHTTP_REQ_OPTIONS = 1 << 5,
384 EVHTTP_REQ_TRACE = 1 << 6,
385 EVHTTP_REQ_CONNECT = 1 << 7,
386 EVHTTP_REQ_PATCH = 1 << 8
398 void (*cb)(
struct evhttp_request *,
void *),
void *arg);
408 void (*cb)(
struct evhttp_request *,
void *));
428 struct event_base *base,
struct evdns_base *dnsbase,
429 const char *address,
unsigned short port);
435 struct evhttp_connection *evcon);
460 void evhttp_connection_set_max_headers_size(
struct evhttp_connection *evcon,
461 ev_ssize_t new_max_headers_size);
463 void evhttp_connection_set_max_body_size(
struct evhttp_connection* evcon,
464 ev_ssize_t new_max_body_size);
471 const char *address);
479 int timeout_in_secs);
487 void (*)(
struct evhttp_connection *,
void *),
void *);
491 char **address, ev_uint16_t *port);
507 struct evhttp_request *req,
537 int evhttp_request_get_response_code(
const struct evhttp_request *req);
586 int evhttp_add_header(
struct evkeyvalq *headers,
const char *key,
const char *value);
625 char *
evhttp_uriencode(
const char *str, ev_ssize_t size,
int space_to_plus);
830 #define EVHTTP_URI_NONCONFORMANT 0x01
857 char *
evhttp_uri_join(
struct evhttp_uri *uri,
char *buf,
size_t limit);