summaryrefslogtreecommitdiff
path: root/http.h
blob: 3cdc062a77591647d337ba25c9a3ef3cb324ddb0 (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,
	HTTP_RESPONSE_NOTFOUND
};

struct http_request {
	int method;
	char *uri;
};

struct http_request http_parse_request(const char *);
void http_free_request(struct http_request *);

void http_response_statusline(enum http_res_code, int);

#endif