0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-16 13:10:24 +00:00
cowboy/test/http_SUITE_data/rest_post_charset_resource.erl

16 lines
421 B
Erlang
Raw Normal View History

-module(rest_post_charset_resource).
-export([init/3, allowed_methods/2, content_types_accepted/2, from_text/2]).
init(_Transport, _Req, _Opts) ->
{upgrade, protocol, cowboy_rest}.
allowed_methods(Req, State) ->
{[<<"POST">>], Req, State}.
content_types_accepted(Req, State) ->
{[{{<<"text">>, <<"plain">>, [{<<"charset">>, <<"utf-8">>}]},
from_text}], Req, State}.
from_text(Req, State) ->
{true, Req, State}.