mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 20:50:24 +00:00
Fix echo_get example
This commit is contained in:
parent
fd07b38952
commit
98323c2d72
3 changed files with 35 additions and 13 deletions
|
@ -14,9 +14,9 @@ init(Req, Opts) ->
|
|||
echo(<<"GET">>, undefined, Req) ->
|
||||
cowboy_req:reply(400, [], <<"Missing echo parameter.">>, Req);
|
||||
echo(<<"GET">>, Echo, Req) ->
|
||||
cowboy_req:reply(200, [
|
||||
{<<"content-type">>, <<"text/plain; charset=utf-8">>}
|
||||
], Echo, Req);
|
||||
cowboy_req:reply(200, #{
|
||||
<<"content-type">> => <<"text/plain; charset=utf-8">>
|
||||
}, Echo, Req);
|
||||
echo(_, _, Req) ->
|
||||
%% Method not allowed.
|
||||
cowboy_req:reply(405, Req).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue