diff options
Diffstat (limited to 'examples/echo_post')
-rw-r--r-- | examples/echo_post/Makefile | 2 | ||||
-rw-r--r-- | examples/echo_post/src/toppage_h.erl | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/examples/echo_post/Makefile b/examples/echo_post/Makefile index c1d64fe..86e5cd2 100644 --- a/examples/echo_post/Makefile +++ b/examples/echo_post/Makefile @@ -5,4 +5,6 @@ PROJECT_VERSION = 1 DEPS = cowboy dep_cowboy_commit = master +REL_DEPS = relx + include ../../erlang.mk diff --git a/examples/echo_post/src/toppage_h.erl b/examples/echo_post/src/toppage_h.erl index 1c6446a..de3143e 100644 --- a/examples/echo_post/src/toppage_h.erl +++ b/examples/echo_post/src/toppage_h.erl @@ -16,13 +16,13 @@ maybe_echo(<<"POST">>, true, Req0) -> Echo = proplists:get_value(<<"echo">>, PostVals), echo(Echo, Req); maybe_echo(<<"POST">>, false, Req) -> - cowboy_req:reply(400, [], <<"Missing body.">>, Req); + cowboy_req:reply(400, #{}, <<"Missing body.">>, Req); maybe_echo(_, _, Req) -> %% Method not allowed. cowboy_req:reply(405, Req). echo(undefined, Req) -> - cowboy_req:reply(400, [], <<"Missing echo parameter.">>, Req); + cowboy_req:reply(400, #{}, <<"Missing echo parameter.">>, Req); echo(Echo, Req) -> cowboy_req:reply(200, #{ <<"content-type">> => <<"text/plain; charset=utf-8">> |