mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Rename cowboy_http_rest to cowboy_rest
This commit is contained in:
parent
d3dcaf109b
commit
6d84afd16d
7 changed files with 9 additions and 9 deletions
|
@ -10,7 +10,7 @@
|
||||||
-export([hello_to_text/2]).
|
-export([hello_to_text/2]).
|
||||||
|
|
||||||
init(_Transport, _Req, []) ->
|
init(_Transport, _Req, []) ->
|
||||||
{upgrade, protocol, cowboy_http_rest}.
|
{upgrade, protocol, cowboy_rest}.
|
||||||
|
|
||||||
content_types_provided(Req, State) ->
|
content_types_provided(Req, State) ->
|
||||||
{[
|
{[
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
%% `application/octet-stream'. This can be overriden by supplying a list
|
%% `application/octet-stream'. This can be overriden by supplying a list
|
||||||
%% of filename extension to mimetypes pairs in the `mimetypes' option.
|
%% of filename extension to mimetypes pairs in the `mimetypes' option.
|
||||||
%% The filename extension should be a binary string including the leading dot.
|
%% The filename extension should be a binary string including the leading dot.
|
||||||
%% The mimetypes must be of a type that the `cowboy_http_rest' protocol can
|
%% The mimetypes must be of a type that the `cowboy_rest' protocol can
|
||||||
%% handle.
|
%% handle.
|
||||||
%%
|
%%
|
||||||
%% The <a href="https://github.com/spawngrid/mimetypes">spawngrid/mimetypes</a>
|
%% The <a href="https://github.com/spawngrid/mimetypes">spawngrid/mimetypes</a>
|
||||||
|
@ -176,7 +176,7 @@
|
||||||
%% cowboy_protocol callbacks
|
%% cowboy_protocol callbacks
|
||||||
-export([init/3]).
|
-export([init/3]).
|
||||||
|
|
||||||
%% cowboy_http_rest callbacks
|
%% cowboy_rest callbacks
|
||||||
-export([rest_init/2]).
|
-export([rest_init/2]).
|
||||||
-export([allowed_methods/2]).
|
-export([allowed_methods/2]).
|
||||||
-export([malformed_request/2]).
|
-export([malformed_request/2]).
|
||||||
|
@ -208,7 +208,7 @@
|
||||||
|
|
||||||
%% @private Upgrade from HTTP handler to REST handler.
|
%% @private Upgrade from HTTP handler to REST handler.
|
||||||
init({_Transport, http}, _Req, _Opts) ->
|
init({_Transport, http}, _Req, _Opts) ->
|
||||||
{upgrade, protocol, cowboy_http_rest}.
|
{upgrade, protocol, cowboy_rest}.
|
||||||
|
|
||||||
|
|
||||||
%% @private Set up initial state of REST handler.
|
%% @private Set up initial state of REST handler.
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
%% can be found in the Webmachine source tree, and on the Webmachine
|
%% can be found in the Webmachine source tree, and on the Webmachine
|
||||||
%% documentation available at http://wiki.basho.com/Webmachine.html
|
%% documentation available at http://wiki.basho.com/Webmachine.html
|
||||||
%% at the time of writing.
|
%% at the time of writing.
|
||||||
-module(cowboy_http_rest).
|
-module(cowboy_rest).
|
||||||
|
|
||||||
-export([upgrade/4]).
|
-export([upgrade/4]).
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
post_is_create/2, create_path/2, to_text/2, from_text/2]).
|
post_is_create/2, create_path/2, to_text/2, from_text/2]).
|
||||||
|
|
||||||
init(_Transport, _Req, _Opts) ->
|
init(_Transport, _Req, _Opts) ->
|
||||||
{upgrade, protocol, cowboy_http_rest}.
|
{upgrade, protocol, cowboy_rest}.
|
||||||
|
|
||||||
rest_init(Req, [Forbidden]) ->
|
rest_init(Req, [Forbidden]) ->
|
||||||
{ok, Req, Forbidden}.
|
{ok, Req, Forbidden}.
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
get_text_plain/2]).
|
get_text_plain/2]).
|
||||||
|
|
||||||
init(_Transport, _Req, _Opts) ->
|
init(_Transport, _Req, _Opts) ->
|
||||||
{upgrade, protocol, cowboy_http_rest}.
|
{upgrade, protocol, cowboy_rest}.
|
||||||
|
|
||||||
allowed_methods(Req, State) ->
|
allowed_methods(Req, State) ->
|
||||||
{['GET', 'HEAD', 'DELETE'], Req, State}.
|
{['GET', 'HEAD', 'DELETE'], Req, State}.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
-export([init/3, generate_etag/2, content_types_provided/2, get_text_plain/2]).
|
-export([init/3, generate_etag/2, content_types_provided/2, get_text_plain/2]).
|
||||||
|
|
||||||
init(_Transport, _Req, _Opts) ->
|
init(_Transport, _Req, _Opts) ->
|
||||||
{upgrade, protocol, cowboy_http_rest}.
|
{upgrade, protocol, cowboy_rest}.
|
||||||
|
|
||||||
generate_etag(Req, State) ->
|
generate_etag(Req, State) ->
|
||||||
case cowboy_req:qs_val(<<"type">>, Req) of
|
case cowboy_req:qs_val(<<"type">>, Req) of
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
-export([init/3, content_types_provided/2, get_text_plain/2]).
|
-export([init/3, content_types_provided/2, get_text_plain/2]).
|
||||||
|
|
||||||
init(_Transport, _Req, _Opts) ->
|
init(_Transport, _Req, _Opts) ->
|
||||||
{upgrade, protocol, cowboy_http_rest}.
|
{upgrade, protocol, cowboy_rest}.
|
||||||
|
|
||||||
content_types_provided(Req, State) ->
|
content_types_provided(Req, State) ->
|
||||||
{[{{<<"text">>, <<"plain">>, []}, get_text_plain}], Req, State}.
|
{[{{<<"text">>, <<"plain">>, []}, get_text_plain}], Req, State}.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue