summaryrefslogtreecommitdiffstats
path: root/docs/en/cowboy/2.0/guide/resp/index.html
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-04-04 13:13:37 +0200
committerLoïc Hoguin <[email protected]>2018-04-04 13:13:37 +0200
commitd2a3f2cedd7c00d0933222aed9c06b3149aa4db4 (patch)
tree4f1499bac639c782b250af0fbf0dec2064315813 /docs/en/cowboy/2.0/guide/resp/index.html
parent1d654719f5fa6be67d2c95145872068665702cb7 (diff)
downloadninenines.eu-d2a3f2cedd7c00d0933222aed9c06b3149aa4db4.tar.gz
ninenines.eu-d2a3f2cedd7c00d0933222aed9c06b3149aa4db4.tar.bz2
ninenines.eu-d2a3f2cedd7c00d0933222aed9c06b3149aa4db4.zip
Cowboy 2.3.0
Diffstat (limited to 'docs/en/cowboy/2.0/guide/resp/index.html')
-rw-r--r--docs/en/cowboy/2.0/guide/resp/index.html36
1 files changed, 19 insertions, 17 deletions
diff --git a/docs/en/cowboy/2.0/guide/resp/index.html b/docs/en/cowboy/2.0/guide/resp/index.html
index e555fe38..53db6025 100644
--- a/docs/en/cowboy/2.0/guide/resp/index.html
+++ b/docs/en/cowboy/2.0/guide/resp/index.html
@@ -7,7 +7,7 @@
<meta name="description" content="">
<meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
- <meta name="generator" content="Hugo 0.30.2" />
+ <meta name="generator" content="Hugo 0.37.1" />
<title>Nine Nines: Sending a response</title>
@@ -90,7 +90,7 @@ cases, Cowboy will add any headers required by the protocol
<div class="paragraph"><p>When you need to set only the status code,
use <code>cowboy_req:reply/2</code>:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -98,7 +98,7 @@ http://www.gnu.org/software/src-highlite -->
<div class="paragraph"><p>When you need to set response headers at the same time,
use <code>cowboy_req:reply/3</code>:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -110,7 +110,7 @@ binary.</p></div>
<div class="paragraph"><p>When you also need to set the response body,
use <code>cowboy_req:reply/4</code>:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -126,7 +126,7 @@ binaries, characters, strings or other iolists. This
allows you to build a response from different parts
without having to do any concatenation:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -151,7 +151,7 @@ Cowboy will add any required headers to the response.</p></div>
<div class="paragraph"><p>When you need to set only the status code,
use <code>cowboy_req:stream_reply/2</code>:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -168,7 +168,7 @@ not recommended. All responses with a body should have
a content-type. The header can be set beforehand, or
using the <code>cowboy_req:stream_reply/3</code>:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -197,7 +197,7 @@ and sent as part of the response when a reply function is
called.</p></div>
<div class="paragraph"><p>To set response headers:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -207,7 +207,7 @@ http://www.gnu.org/software/src-highlite -->
the <a href="../cookies">Cookies</a> chapter for more information.</p></div>
<div class="paragraph"><p>To check if a response header has already been set:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -215,7 +215,7 @@ http://www.gnu.org/software/src-highlite -->
<div class="paragraph"><p>It returns <code>true</code> if the header was set, <code>false</code> otherwise.</p></div>
<div class="paragraph"><p>To delete a response header that was set previously:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -269,7 +269,7 @@ headers.</p></div>
default sends the server header with the value "Cowboy".
We can override it:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -286,14 +286,14 @@ immediately sending it. It is stored in the Req object and
sent when the reply function is called.</p></div>
<div class="paragraph"><p>To set the response body:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><span style="color: #009900">Req</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:set_resp_body</span></span>(<span style="color: #FF0000">"Hello world!"</span>, <span style="color: #009900">Req0</span>)<span style="color: #990000">.</span></tt></pre></div></div>
<div class="paragraph"><p>To check if a response body has already been set:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -312,7 +312,7 @@ using <code>cowboy_req:reply/4</code>, or when presetting the
response header, you can give a <code>sendfile</code> tuple to
Cowboy:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -323,7 +323,7 @@ entire file may be sent, or just a part of it.</p></div>
Cowboy sends it in the content-length header.</p></div>
<div class="paragraph"><p>To send a file while replying:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -352,7 +352,7 @@ string, set to empty) and the method is GET by default.</p></div>
<div class="paragraph"><p>The following snippet pushes a CSS file that is linked to
in the response:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -368,7 +368,7 @@ http://www.gnu.org/software/src-highlite -->
simply pass in a fourth argument. The following snippet
uses a different host name:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -439,6 +439,8 @@ ultimately send a response to the client.</p></div>
+ <li><a href="/docs/en/cowboy/2.3/guide">2.3</a></li>
+
<li><a href="/docs/en/cowboy/2.2/guide">2.2</a></li>
<li><a href="/docs/en/cowboy/2.1/guide">2.1</a></li>