aboutsummaryrefslogtreecommitdiffstats
path: root/examples/echo_post/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/echo_post/src')
-rw-r--r--examples/echo_post/src/toppage_handler.erl6
1 files changed, 1 insertions, 5 deletions
diff --git a/examples/echo_post/src/toppage_handler.erl b/examples/echo_post/src/toppage_handler.erl
index 2bafed0..de75e5e 100644
--- a/examples/echo_post/src/toppage_handler.erl
+++ b/examples/echo_post/src/toppage_handler.erl
@@ -4,16 +4,12 @@
-module(toppage_handler).
-export([init/2]).
--export([handle/2]).
init(Req, Opts) ->
- {http, Req, Opts}.
-
-handle(Req, State) ->
Method = cowboy_req:method(Req),
HasBody = cowboy_req:has_body(Req),
Req2 = maybe_echo(Method, HasBody, Req),
- {ok, Req2, State}.
+ {ok, Req2, Opts}.
maybe_echo(<<"POST">>, true, Req) ->
{ok, PostVals, Req2} = cowboy_req:body_qs(Req),