-module(method). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). -export([to_string/1]). -export_type([method/0]). -type method() :: get_method | post_method | put_method | patch_method | delete_method | head_method | options_method | trace_method | connect_method | {custom_method, binary()}. -spec to_string(method()) -> binary(). to_string(Method) -> case Method of get_method -> <<"GET"/utf8>>; post_method -> <<"POST"/utf8>>; put_method -> <<"PUT"/utf8>>; patch_method -> <<"PATCH"/utf8>>; delete_method -> <<"DELETE"/utf8>>; head_method -> <<"HEAD"/utf8>>; options_method -> <<"OPTIONS"/utf8>>; trace_method -> <<"TRACE"/utf8>>; connect_method -> <<"CONNECT"/utf8>>; {custom_method, S} -> S end.