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