Add header
This commit is contained in:
parent
fc2128f969
commit
dc9d1fc1be
25
include/http.hrl
Normal file
25
include/http.hrl
Normal file
@ -0,0 +1,25 @@
|
||||
-record(request,
|
||||
{method = undefined :: undefined | method(),
|
||||
path = undefined :: undefined | binary(),
|
||||
qargs = undefined :: undefined | #{Key :: binary() := Value :: binary()},
|
||||
fragment = undefined :: undefined | none | binary(),
|
||||
version = undefined :: undefined | http10 | http11 | http20,
|
||||
headers = undefined :: undefined | [{Key :: binary(), Value :: binary()}],
|
||||
cookies = undefined :: undefined | #{Key :: binary() := Value :: binary()},
|
||||
enctype = undefined :: undefined | none | urlencoded | multipart(),
|
||||
size = undefined :: undefined | none | non_neg_integer(),
|
||||
body = undefined :: undefined | none | body()}).
|
||||
|
||||
-record(response,
|
||||
{type = page :: page | {data, string()},
|
||||
version = http11 :: http11,
|
||||
code = 200 :: pos_integer(),
|
||||
slogan = "" :: string(),
|
||||
headers = [] :: [{Key :: string(), Value :: iolist()}],
|
||||
body = "" :: iolist()}).
|
||||
|
||||
-type method() :: get | post | options.
|
||||
-type multipart() :: {multipart, Boundary :: binary()}.
|
||||
-type body() :: {partial, binary()} | {multipart, [body_part()]} | binary().
|
||||
-type body_part() :: {Field :: binary(), Data :: binary()}
|
||||
| {Field :: binary(), Name :: binary(), Data :: binary()}.
|
Loading…
x
Reference in New Issue
Block a user