mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-16 05:00:24 +00:00
Add tests for responses and request body reading
This is a large commit. The cowboy_req interface has largely changed, and will change a little more. It's possible that some examples or tests have not been converted to the new interface yet. The documentation has not yet been updated. All of this will be fixed in smaller subsequent commits. Gotta start somewhere...
This commit is contained in:
parent
0ba3a9a222
commit
ae0dd61673
12 changed files with 968 additions and 614 deletions
|
@ -27,19 +27,15 @@
|
|||
| {atom(), cowboy_constraints:constraint() | [cowboy_constraints:constraint()], any()}].
|
||||
-export_type([fields/0]).
|
||||
|
||||
-type http_headers() :: [{binary(), iodata()}].
|
||||
-type http_headers() :: #{binary() => iodata()}.
|
||||
-export_type([http_headers/0]).
|
||||
|
||||
-type http_status() :: non_neg_integer() | binary().
|
||||
-export_type([http_status/0]).
|
||||
|
||||
-type http_version() :: 'HTTP/1.1' | 'HTTP/1.0'.
|
||||
-type http_version() :: 'HTTP/2' | 'HTTP/1.1' | 'HTTP/1.0'.
|
||||
-export_type([http_version/0]).
|
||||
|
||||
-type onresponse_fun() ::
|
||||
fun((http_status(), http_headers(), iodata(), Req) -> Req).
|
||||
-export_type([onresponse_fun/0]).
|
||||
|
||||
-spec start_clear(ranch:ref(), non_neg_integer(), ranch_tcp:opts(),
|
||||
cowboy_protocol:opts()) -> {ok, pid()} | {error, any()}.
|
||||
start_clear(Ref, NbAcceptors, TransOpts0, ProtoOpts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue