diff options
author | Anatolii Kosorukov <[email protected]> | 2022-05-16 14:34:43 +0300 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2023-12-07 13:16:09 +0100 |
commit | 4907734a83b1081e170bf48dbf22f27e800823d0 (patch) | |
tree | 64e5d685955b4f188f8dbbe36ae2b1571210fe1d /examples/echo_post/src | |
parent | b12b4300bad166e91c894d978220a28ccfc4e2bc (diff) | |
download | cowboy-4907734a83b1081e170bf48dbf22f27e800823d0.tar.gz cowboy-4907734a83b1081e170bf48dbf22f27e800823d0.tar.bz2 cowboy-4907734a83b1081e170bf48dbf22f27e800823d0.zip |
Fix echo_post example
Fix input parameter of `cowboy_req:reply` function.
Diffstat (limited to 'examples/echo_post/src')
-rw-r--r-- | examples/echo_post/src/toppage_h.erl | 4 |
1 files changed, 2 insertions, 2 deletions
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">> |