blob: 1e97820559598fbbb2e07b487e290002c37b7b84 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#ifndef _H_HTTP
#define _H_HTTP
#include <stddef.h>
#define CFWS_MAXURI 128
#define CFWS_MAX_RESPONSE 4096
enum http_req_method {
HTTP_METHOD_GET
};
enum http_res_code {
HTTP_RESPONSE_OK = 200,
HTTP_RESPONSE_NOTFOUND = 404
};
struct http_request {
int method;
char *uri;
};
struct http_request http_parse_request(const char *);
void http_free_request(struct http_request *);
int http_build_response(char *, enum http_res_code, const char *, size_t);
#endif
|