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

15 lines
355 B
Erlang
Raw Normal View History

%% Feel free to use, reuse and abuse the code in this file.
-module(http_handler).
-export([init/2]).
-export([handle/2]).
init(Req, Opts) ->
{http, Req, Opts}.
handle(Req, State) ->
Headers = proplists:get_value(headers, State, []),
Body = proplists:get_value(body, State, "http_handler"),
{ok, cowboy_req:reply(200, Headers, Body, Req), State}.