0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 20:50:24 +00:00

Convert the GET echo example to a release

This commit is contained in:
Loïc Hoguin 2013-09-07 22:26:40 +02:00
parent 340f0a5112
commit e2b11bbeed
7 changed files with 38 additions and 38 deletions

View file

@ -19,8 +19,9 @@ handle(Req, State) ->
echo(<<"GET">>, undefined, Req) ->
cowboy_req:reply(400, [], <<"Missing echo parameter.">>, Req);
echo(<<"GET">>, Echo, Req) ->
cowboy_req:reply(200,
[{<<"content-encoding">>, <<"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).