1
2
3
4
5
6
7
8
9
10
11
12
..
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
-- vim: ft=terra
local m = {}
local util = lib.util
m.method = lib.enum { 'get', 'post', 'head', 'options', 'put', 'delete' }
m.mime = lib.enum {
'html'; -- default
'json';
'mkdown';
'text';
'ansi';
'none';
................................................................................
key: rawstring
value: rawstring
}
struct m.page {
respcode: uint16
body: lib.mem.ptr(int8)
headers: lib.mem.ptr(m.header)
}
local resps = {
[200] = 'OK';
[201] = 'Created';
[301] = 'Moved Permanently';
[302] = 'Found';
|
|
1
2
3
4
5
6
7
8
9
10
11
12
..
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
-- vim: ft=terra
local m = {}
local util = lib.util
m.method = lib.enum { 'get', 'post', 'post_file', 'head', 'options', 'put', 'delete' }
m.mime = lib.enum {
'html'; -- default
'json';
'mkdown';
'text';
'ansi';
'none';
................................................................................
key: rawstring
value: rawstring
}
struct m.page {
respcode: uint16
body: lib.mem.ptr(int8)
headers: lib.mem.ptr(m.header)
}
struct m.upload {
ctype: lib.str.t;
filename: lib.str.t;
field: lib.str.t;
body: lib.str.t;
}
local resps = {
[200] = 'OK';
[201] = 'Created';
[301] = 'Moved Permanently';
[302] = 'Found';
|