blob: 90bd4f3bb997c2a83dbbe836caa7099205818b58 (
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
29
30
31
32
|
#ifndef _H_HTTP
#define _H_HTTP
#include <stddef.h>
#define CFWS_MAXURI 128
#define CFWS_MAX_RESPONSE 4096
enum http_req_method {
HTTP_METHOD_UNKNOWN,
HTTP_METHOD_GET
};
enum http_res_code {
HTTP_RESPONSE_OK,
HTTP_RESPONSE_BADREQUEST,
HTTP_RESPONSE_NOTFOUND,
HTTP_RESPONSE_NOTIMPLEMENTED
};
struct http_request {
int method;
char *uri;
char *query_str;
};
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
|