From b5d4cb91f80c833795a2d87050c3674bb7aecdc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 3 Oct 2017 13:39:41 +0200 Subject: Update Hugo, docs --- .../cowboy/2.0/manual/cowboy_req.method/index.html | 190 ++++++++++----------- 1 file changed, 95 insertions(+), 95 deletions(-) (limited to 'docs/en/cowboy/2.0/manual/cowboy_req.method/index.html') diff --git a/docs/en/cowboy/2.0/manual/cowboy_req.method/index.html b/docs/en/cowboy/2.0/manual/cowboy_req.method/index.html index da70b08c..1beab4a6 100644 --- a/docs/en/cowboy/2.0/manual/cowboy_req.method/index.html +++ b/docs/en/cowboy/2.0/manual/cowboy_req.method/index.html @@ -7,7 +7,7 @@ - + Nine Nines: cowboy_req:method(3) @@ -67,100 +67,100 @@

cowboy_req:method(3)

-
-

Name

-
-

cowboy_req:method - HTTP method

-
-
-
-

Description

-
-
-
-
method(Req :: cowboy_req:req()) -> Method :: binary()
-

Return the request’s HTTP method.

-

The method can also be obtained using pattern matching:

-
-
-
#{method := Method} = Req.
-
-
-
-

Arguments

-
-
-
-Req -
-
-

-The Req object. -

-
-
-
-
-
-

Return value

-
-

The request’s HTTP method is returned as a binary string. -While methods are case sensitive, standard methods are -always uppercase.

-
-
-
-

Changelog

-
-
    -
  • -

    -2.0: Only the method is returned, it is no longer wrapped in a tuple. -

    -
  • -
  • -

    -1.0: Function introduced. -

    -
  • -
-
-
-
-

Examples

-
-
-
Ensure the request’s method is GET
-
-
<<"GET">> = cowboy_req:method(Req).
-
-
Allow methods from list
-
-
init(Req, State) ->
-    case lists:member(cowboy_req:method(Req), [<<"GET">>, <<"POST">>]) of
-        true -> handle(Req, State);
-        false -> method_not_allowed(Req, State)
-    end.
-
-
-
-

See also

- -
+
+

Name

+
+

cowboy_req:method - HTTP method

+
+
+
+

Description

+
+
+
+
method(Req :: cowboy_req:req()) -> Method :: binary()
+

Return the request’s HTTP method.

+

The method can also be obtained using pattern matching:

+
+
+
#{method := Method} = Req.
+
+
+
+

Arguments

+
+
+
+Req +
+
+

+The Req object. +

+
+
+
+
+
+

Return value

+
+

The request’s HTTP method is returned as a binary string. +While methods are case sensitive, standard methods are +always uppercase.

+
+
+
+

Changelog

+
+
    +
  • +

    +2.0: Only the method is returned, it is no longer wrapped in a tuple. +

    +
  • +
  • +

    +1.0: Function introduced. +

    +
  • +
+
+
+
+

Examples

+
+
+
Ensure the request’s method is GET
+
+
<<"GET">> = cowboy_req:method(Req).
+
+
Allow methods from list
+
+
init(Req, State) ->
+    case lists:member(cowboy_req:method(Req), [<<"GET">>, <<"POST">>]) of
+        true -> handle(Req, State);
+        false -> method_not_allowed(Req, State)
+    end.
+
+
+
+

See also

+ +
-- cgit v1.2.3