2012-01-23 16:10:41 -06:00
|
|
|
-module(rest_nodelete_resource).
|
|
|
|
|
2014-09-26 15:58:44 +03:00
|
|
|
-export([init/2]).
|
|
|
|
-export([allowed_methods/2]).
|
|
|
|
-export([content_types_provided/2]).
|
|
|
|
-export([get_text_plain/2]).
|
|
|
|
|
|
|
|
init(Req, Opts) ->
|
2014-09-30 20:12:13 +03:00
|
|
|
{cowboy_rest, Req, Opts}.
|
2012-01-23 16:10:41 -06:00
|
|
|
|
|
|
|
allowed_methods(Req, State) ->
|
2012-09-20 06:22:51 +02:00
|
|
|
{[<<"GET">>, <<"HEAD">>, <<"DELETE">>], Req, State}.
|
2012-01-23 16:10:41 -06:00
|
|
|
|
|
|
|
content_types_provided(Req, State) ->
|
|
|
|
{[{{<<"text">>, <<"plain">>, []}, get_text_plain}], Req, State}.
|
|
|
|
|
|
|
|
get_text_plain(Req, State) ->
|
|
|
|
{<<"This is REST!">>, Req, State}.
|