0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 20:50:24 +00:00

Use spaces in snippets in the guide

This commit is contained in:
Loïc Hoguin 2016-09-14 18:51:11 +02:00
parent a231216b07
commit 31cabe0fb9
10 changed files with 104 additions and 104 deletions

View file

@ -32,15 +32,15 @@ otherwise.
[source,erlang]
----
init(Req0=#{method := <<"GET">>}, State) ->
Req = cowboy_req:reply(200, #{
<<"content-type">> => <<"text/plain">>
}, <<"Hello world!">>, Req0),
{ok, Req, State};
Req = cowboy_req:reply(200, #{
<<"content-type">> => <<"text/plain">>
}, <<"Hello world!">>, Req0),
{ok, Req, State};
init(Req0, State) ->
Req = cowboy_req:reply(405, #{
<<"allow">> => <<"GET">>
}, Req0),
{ok, Req, State}.
Req = cowboy_req:reply(405, #{
<<"allow">> => <<"GET">>
}, Req0),
{ok, Req, State}.
----
Any other field is internal and should not be accessed.
@ -135,11 +135,11 @@ of the effective request URI can all be retrieved directly:
[source,erlang]
----
#{
scheme := Scheme,
host := Host,
port := Port,
path := Path,
qs := Qs
scheme := Scheme,
host := Host,
port := Port,
path := Path,
qs := Qs
} = Req.
----
@ -348,7 +348,7 @@ directly:
[source,erlang]
----
ParsedVal = cowboy_req:parse_header(<<"content-type">>, Req,
{<<"text">>, <<"plain">>, []}).
{<<"text">>, <<"plain">>, []}).
----
=== Peer