rsstats 0.0.1
Redis Enterprise Statistic collector
libhttp.h
Go to the documentation of this file.
1
21#ifndef __LIBHTTP_H__
22#define __LIBHTTP_H__
23
24typedef enum HTTPVersion_e {
33
34typedef enum HTTPMethod_e {
46
48
49HTTPHeader_t* HTTPHeader_new(const char* name, const char* value);
50void HTTPHeader_del(HTTPHeader_t* header);
51HTTPHeader_t* HTTPHeader_basicauth(const char* login, const char* pass);
52char* HTTPHeader_getname(HTTPHeader_t* header);
54
55typedef struct HTTP_s HTTP_t;
56
58void HTTP_del(HTTP_t* http);
59char* HTTP_setbody(HTTP_t* http, const char* body);
60char* HTTP_getbody(HTTP_t* http);
64HTTPHeader_t* HTTP_findheader(const HTTPHeader_t* start, const char* name, const char* value);
66
67char* HTTP_buildrequest(const HTTPMethod_t method, const char* uri, const HTTPVersion_t version);
68char* HTTP_buildheaders(const HTTP_t* http);
69/*
70void HTTP_parserequest(const char* request, HTTP_t** http, HTTP_Method_t method, char* uri, HTTPVersion_t version);
71 * typedef enum HTTPStatus_e HTTPStatus_t;
72 *
73 * char* HTTP_buildreply(const HTTP_t* http, const HTTPVersion_t, const HTTPStatus_t);
74 * void HTTP_parsereply(const char* reply, HTTP_t** http, HTTPVersion_t*, HTTPStatus_t*);
75 */
76
77#endif /* __LIBHTTP_H__ */
const char *const name
Definition: cJSON.h:268
HTTPHeader_t * HTTP_firstheader(const HTTP_t *http)
Definition: libhttp.c:204
enum HTTPVersion_e HTTPVersion_t
char * HTTP_setbody(HTTP_t *http, const char *body)
Definition: libhttp.c:161
char * HTTPHeader_getvalue(HTTPHeader_t *header)
Definition: libhttp.c:108
void HTTPHeader_del(HTTPHeader_t *header)
Definition: libhttp.c:64
void HTTP_del(HTTP_t *http)
Definition: libhttp.c:138
HTTP_t * HTTP_addheader(HTTP_t *http, HTTPHeader_t *header)
Definition: libhttp.c:185
HTTPMethod_e
Definition: libhttp.h:34
@ HTTPMETHOD_PUT
Definition: libhttp.h:38
@ HTTPMETHOD_POST
Definition: libhttp.h:37
@ HTTPMETHOD_CONNECT
Definition: libhttp.h:40
@ HTTPMETHOD_TRACE
Definition: libhttp.h:42
@ HTTPMETHOD_PATCH
Definition: libhttp.h:43
@ HTTPMETHOD_DELETE
Definition: libhttp.h:39
@ HTTPMETHOD_OPTIONS
Definition: libhttp.h:41
@ HTTPMETHOD_GET
Definition: libhttp.h:35
@ HTTPMETHOD_INVALID
Definition: libhttp.h:44
@ HTTPMETHOD_HEAD
Definition: libhttp.h:36
HTTPVersion_e
Definition: libhttp.h:24
@ HTTPVERSION_HTTP11b
Definition: libhttp.h:28
@ HTTPVERSION_INVALID
Definition: libhttp.h:31
@ HTTPVERSION_HTTP09
Definition: libhttp.h:25
@ HTTPVERSION_HTTP2
Definition: libhttp.h:29
@ HTTPVERSION_HTTP10
Definition: libhttp.h:26
@ HTTPVERSION_HTTP3
Definition: libhttp.h:30
@ HTTPVERSION_HTTP11
Definition: libhttp.h:27
enum HTTPMethod_e HTTPMethod_t
char * HTTP_buildheaders(const HTTP_t *http)
Definition: libhttp.c:350
HTTP_t * HTTP_new()
Definition: libhttp.c:113
HTTPHeader_t * HTTPHeader_basicauth(const char *login, const char *pass)
Definition: libhttp.c:74
char * HTTP_getbody(HTTP_t *http)
Definition: libhttp.c:178
HTTPHeader_t * HTTPHeader_new(const char *name, const char *value)
Definition: libhttp.c:39
char * HTTPHeader_getname(HTTPHeader_t *header)
Definition: libhttp.c:103
char * HTTP_buildrequest(const HTTPMethod_t method, const char *uri, const HTTPVersion_t version)
Definition: libhttp.c:277
HTTP_t * HTTP_delheader(HTTP_t *http, HTTPHeader_t *header)
Definition: libhttp.c:257
HTTPHeader_t * HTTP_nextheader(const HTTPHeader_t *header)
Definition: libhttp.c:213
HTTPHeader_t * HTTP_findheader(const HTTPHeader_t *start, const char *name, const char *value)
Definition: libhttp.c:227
Definition: libhttp.c:28
char * body
Definition: libhttp.c:30
char * value
Definition: libhttp.c:36