Current section

Files

Jump to
typed_headers src typed_headers@method.erl
Raw

src/typed_headers@method.erl

-module(typed_headers@method).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([to_string/1]).
-export_type([method/0]).
-type method() :: get |
post |
put |
patch |
delete |
head |
options |
trace |
connect |
{custom, binary()}.
-spec to_string(method()) -> binary().
to_string(Method) ->
case Method of
get ->
<<"GET"/utf8>>;
post ->
<<"POST"/utf8>>;
put ->
<<"PUT"/utf8>>;
patch ->
<<"PATCH"/utf8>>;
delete ->
<<"DELETE"/utf8>>;
head ->
<<"HEAD"/utf8>>;
options ->
<<"OPTIONS"/utf8>>;
trace ->
<<"TRACE"/utf8>>;
connect ->
<<"CONNECT"/utf8>>;
{custom, S} ->
S
end.