mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-16 05:00:24 +00:00
Add shortcuts to reply functions
New functions are reply/2, reply/3, chunked_reply/2 in cowboy_http_req.
This commit is contained in:
parent
2a324aca3a
commit
81cc99d10b
5 changed files with 21 additions and 5 deletions
|
@ -8,7 +8,7 @@ init({_Transport, http}, Req, _Opts) ->
|
|||
{ok, Req, undefined}.
|
||||
|
||||
handle(Req, State) ->
|
||||
{ok, Req2} = cowboy_http_req:chunked_reply(200, [], Req),
|
||||
{ok, Req2} = cowboy_http_req:chunked_reply(200, Req),
|
||||
cowboy_http_req:chunk("chunked_handler\r\n", Req2),
|
||||
cowboy_http_req:chunk("works fine!", Req2),
|
||||
{ok, Req2, State}.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue