32 lines
626 B
C
32 lines
626 B
C
|
#ifndef HTTP_REQ
|
||
|
#define HTTP_REQ
|
||
|
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
#include "picohttpparser.h"
|
||
|
|
||
|
#define HTTP_MAX_ALLOWED_HEADERS 16
|
||
|
|
||
|
typedef enum http_request_method {
|
||
|
http_request_method_get = 0,
|
||
|
http_request_method_post = 1,
|
||
|
http_request_method_put = 2,
|
||
|
http_request_method_patch = 3,
|
||
|
http_request_method_delete = 4
|
||
|
} http_request_method;
|
||
|
|
||
|
/*
|
||
|
* Struct representing the specific type of request
|
||
|
*/
|
||
|
typedef struct http_request {
|
||
|
size_t len;
|
||
|
int minor_version;
|
||
|
const char *method;
|
||
|
size_t method_len;
|
||
|
const char *path;
|
||
|
size_t path_len;
|
||
|
struct phr_header headers[HTTP_MAX_ALLOWED_HEADERS];
|
||
|
} http_request;
|
||
|
|
||
|
#endif
|