jf-framework
Loading...
Searching...
No Matches
http.h
Go to the documentation of this file.
1
6
7#ifndef JF_FRAMEWORK_HTTP_H
8#define JF_FRAMEWORK_HTTP_H
9
10#include <stddef.h>
11#include <stdint.h>
12
13// https://www.rfc-editor.org/info/rfc2616/
14typedef struct {
15 char method[8];
16 char path[256];
17 char version[16];
18 char query[256];
19 char host[256];
20 char contentType[128];
21 size_t contentLength;
22 struct {
23 char name[64];
24 char value[256];
25 } headers[32];
26 uint32_t headerCount;
27 const char* body;
28 size_t bodyLength;
29 struct {
30 char key[32];
31 char value[128];
32 } params[32];
33 uint32_t paramCount;
35
36typedef struct {
37 uint32_t response;
38 char reason[64];
39 char contentType[128];
40 size_t contentLength;
41 struct {
42 char name[64];
43 char value[256];
44 } headers[32];
45 uint32_t headerCount;
46 char* body;
47 size_t bodyCapacity;
49
50uint32_t jf_ParseHttpRequest(HttpRequest* httpRequest, const char* buffer, size_t length);
51
52#endif
uint32_t jf_ParseHttpRequest(HttpRequest *httpRequest, const char *buffer, size_t length)
Parses the HTTP request.
Definition http.c:24
Definition http.h:14
Definition http.h:36