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.scheme/index.html | 168 ++++++++++----------- 1 file changed, 84 insertions(+), 84 deletions(-) (limited to 'docs/en/cowboy/2.0/manual/cowboy_req.scheme/index.html') diff --git a/docs/en/cowboy/2.0/manual/cowboy_req.scheme/index.html b/docs/en/cowboy/2.0/manual/cowboy_req.scheme/index.html index 12e1fb8b..cb8ea3b9 100644 --- a/docs/en/cowboy/2.0/manual/cowboy_req.scheme/index.html +++ b/docs/en/cowboy/2.0/manual/cowboy_req.scheme/index.html @@ -7,7 +7,7 @@ - + Nine Nines: cowboy_req:scheme(3) @@ -67,89 +67,89 @@

cowboy_req:scheme(3)

-
-

Name

-
-

cowboy_req:scheme - URI scheme

-
-
-
-

Description

-
-
-
-
scheme(Req :: cowboy_req:req()) -> Scheme :: binary()
-

Return the scheme of the effective request URI.

-

The scheme can also be obtained using pattern matching:

-
-
-
#{scheme := Scheme} = Req.
-
-
-
-

Arguments

-
-
-
-Req -
-
-

-The Req object. -

-
-
-
-
-
-

Return value

-
-

The scheme is returned as a binary. It is case insensitive.

-

Cowboy will only set the scheme to <<"http">> or <<"https">>.

-
-
-
-

Changelog

-
-
    -
  • -

    -2.0: Function introduced. -

    -
  • -
-
-
-
-

Examples

-
-
-
Redirect HTTP to HTTPS
-
-
init(Req0=#{scheme := <<"http">>}, State) ->
-    Req = cowboy_req:reply(302, #{
-        <<"location">> => cowboy_req:uri(Req, #{scheme => <<"https">>})
-    }, Req0),
-    {ok, Req, State};
-init(Req, State) ->
-    {cowboy_rest, Req, State}.
-
-
-
-

See also

- -
+
+

Name

+
+

cowboy_req:scheme - URI scheme

+
+
+
+

Description

+
+
+
+
scheme(Req :: cowboy_req:req()) -> Scheme :: binary()
+

Return the scheme of the effective request URI.

+

The scheme can also be obtained using pattern matching:

+
+
+
#{scheme := Scheme} = Req.
+
+
+
+

Arguments

+
+
+
+Req +
+
+

+The Req object. +

+
+
+
+
+
+

Return value

+
+

The scheme is returned as a binary. It is case insensitive.

+

Cowboy will only set the scheme to <<"http">> or <<"https">>.

+
+
+
+

Changelog

+
+
    +
  • +

    +2.0: Function introduced. +

    +
  • +
+
+
+
+

Examples

+
+
+
Redirect HTTP to HTTPS
+
+
init(Req0=#{scheme := <<"http">>}, State) ->
+    Req = cowboy_req:reply(302, #{
+        <<"location">> => cowboy_req:uri(Req, #{scheme => <<"https">>})
+    }, Req0),
+    {ok, Req, State};
+init(Req, State) ->
+    {cowboy_rest, Req, State}.
+
+
+
+

See also

+ +
-- cgit v1.2.3