summaryrefslogtreecommitdiffstats
path: root/docs/en/cowboy/2.0/manual/cowboy_req.stream_reply/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/en/cowboy/2.0/manual/cowboy_req.stream_reply/index.html')
-rw-r--r--docs/en/cowboy/2.0/manual/cowboy_req.stream_reply/index.html286
1 files changed, 143 insertions, 143 deletions
diff --git a/docs/en/cowboy/2.0/manual/cowboy_req.stream_reply/index.html b/docs/en/cowboy/2.0/manual/cowboy_req.stream_reply/index.html
index 0c3dc711..a2b9bef1 100644
--- a/docs/en/cowboy/2.0/manual/cowboy_req.stream_reply/index.html
+++ b/docs/en/cowboy/2.0/manual/cowboy_req.stream_reply/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.17" />
+ <meta name="generator" content="Hugo 0.26" />
<title>Nine Nines: cowboy_req:stream_reply(3)</title>
@@ -67,148 +67,148 @@
<h1 class="lined-header"><span>cowboy_req:stream_reply(3)</span></h1>
-<div class="sect1">
-<h2 id="_name">Name</h2>
-<div class="sectionbody">
-<div class="paragraph"><p>cowboy_req:stream_reply - Send the response headers</p></div>
-</div>
-</div>
-<div class="sect1">
-<h2 id="_description">Description</h2>
-<div class="sectionbody">
-<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="font-weight: bold"><span style="color: #000000">stream_reply</span></span>(<span style="color: #009900">Status</span>, <span style="color: #009900">Req</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:req</span></span>())
- <span style="color: #990000">-&gt;</span> <span style="font-weight: bold"><span style="color: #000000">stream_reply</span></span>(<span style="color: #009900">StatusCode</span>, #{}, <span style="color: #009900">Req</span>)
-
-<span style="font-weight: bold"><span style="color: #000000">stream_reply</span></span>(<span style="color: #009900">Status</span>, <span style="color: #009900">Headers</span>, <span style="color: #009900">Req</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:req</span></span>())
- <span style="color: #990000">-&gt;</span> <span style="color: #009900">Req</span>
-
-<span style="color: #009900">Status</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000000">cowboy:http_status</span></span>()
-<span style="color: #009900">Headers</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000000">cowboy:http_headers</span></span>()</tt></pre></div></div>
-<div class="paragraph"><p>Send the response headers.</p></div>
-<div class="paragraph"><p>The header names must be given as lowercase binary strings.
-While header names are case insensitive, Cowboy requires them
-to be given as lowercase to function properly.</p></div>
-<div class="paragraph"><p>Cowboy does not allow duplicate header names. Headers set
-by this function may overwrite those set by <code>set_resp_header/3</code>.</p></div>
-<div class="paragraph"><p>Use <a href="../cowboy_req.set_resp_cookie">cowboy_req:set_resp_cookie(3)</a>
-instead of this function to set cookies.</p></div>
-<div class="paragraph"><p>If a response body was set before calling this function,
-it will not be sent.</p></div>
-<div class="paragraph"><p>Use <a href="../cowboy_req.stream_body">cowboy_req:stream_body(3)</a>
-to stream the response body.</p></div>
-<div class="paragraph"><p>You may want to set the content-length header when using
-this function, if it is known in advance. This will allow
-clients using HTTP/2 and HTTP/1.0 to process the response
-more efficiently.</p></div>
-<div class="paragraph"><p>The streaming method varies depending on the protocol being
-used. HTTP/2 will use the usual DATA frames. HTTP/1.1 will
-use chunked transfer-encoding. HTTP/1.0 will send the body
-unmodified and close the connection at the end if no
-content-length was set.</p></div>
-<div class="paragraph"><p>It is not possible to push resources after this function
-returns. Any attempt will result in an error.</p></div>
-</div>
-</div>
-<div class="sect1">
-<h2 id="_arguments">Arguments</h2>
-<div class="sectionbody">
-<div class="dlist"><dl>
-<dt class="hdlist1">
-Status
-</dt>
-<dd>
-<p>
-The status code for the response.
-</p>
-</dd>
-<dt class="hdlist1">
-Headers
-</dt>
-<dd>
-<p>
-The response headers.
-</p>
-</dd>
-</dl></div>
-<div class="paragraph"><p>Header names must be given as lowercase binary strings.</p></div>
-<div class="dlist"><dl>
-<dt class="hdlist1">
-Req
-</dt>
-<dd>
-<p>
-The Req object.
-</p>
-</dd>
-</dl></div>
-</div>
-</div>
-<div class="sect1">
-<h2 id="_return_value">Return value</h2>
-<div class="sectionbody">
-<div class="paragraph"><p>A new Req object is returned.</p></div>
-<div class="paragraph"><p>The returned Req object must be used from that point onward
-in order to be able to stream the response body.</p></div>
-</div>
-</div>
-<div class="sect1">
-<h2 id="_changelog">Changelog</h2>
-<div class="sectionbody">
-<div class="ulist"><ul>
-<li>
-<p>
-<strong>2.0</strong>: Only the Req is returned, it is no longer wrapped in a tuple.
-</p>
-</li>
-<li>
-<p>
-<strong>2.0</strong>: Function introduced. Replaces <code>chunked_reply/1,2</code>.
-</p>
-</li>
-</ul></div>
-</div>
-</div>
-<div class="sect1">
-<h2 id="_examples">Examples</h2>
-<div class="sectionbody">
-<div class="listingblock">
-<div class="title">Initiate the response</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-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:stream_reply</span></span>(<span style="color: #993399">200</span>, <span style="color: #009900">Req0</span>)<span style="color: #990000">.</span></tt></pre></div></div>
-<div class="listingblock">
-<div class="title">Stream the response with custom headers</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-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:stream_reply</span></span>(<span style="color: #993399">200</span>, #{
- <span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"content-type"</span><span style="color: #990000">&gt;&gt;</span> <span style="color: #990000">=&gt;</span> <span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"text/plain"</span><span style="color: #990000">&gt;&gt;</span>
-}, <span style="color: #009900">Req0</span>),
-<span style="font-weight: bold"><span style="color: #000000">cowboy_req:stream_body</span></span>(<span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"Hello\n"</span><span style="color: #990000">&gt;&gt;</span>, <span style="color: #FF6600">nofin</span>, <span style="color: #009900">Req</span>),
-<span style="font-weight: bold"><span style="color: #000000">timer:sleep</span></span>(<span style="color: #993399">1000</span>),
-<span style="font-weight: bold"><span style="color: #000000">cowboy_req:stream_body</span></span>(<span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"World!\n"</span><span style="color: #990000">&gt;&gt;</span>, <span style="color: #FF6600">fin</span>, <span style="color: #009900">Req</span>)<span style="color: #990000">.</span></tt></pre></div></div>
-</div>
-</div>
-<div class="sect1">
-<h2 id="_see_also">See also</h2>
-<div class="sectionbody">
-<div class="paragraph"><p><a href="../cowboy_req">cowboy_req(3)</a>,
-<a href="../cowboy_req.set_resp_cookie">cowboy_req:set_resp_cookie(3)</a>,
-<a href="../cowboy_req.set_resp_header">cowboy_req:set_resp_header(3)</a>,
-<a href="../cowboy_req.set_resp_headers">cowboy_req:set_resp_headers(3)</a>,
-<a href="../cowboy_req.reply">cowboy_req:reply(3)</a>,
-<a href="../cowboy_req.stream_body">cowboy_req:stream_body(3)</a>,
-<a href="../cowboy_req.push">cowboy_req:push(3)</a></p></div>
-</div>
-</div>
+<div class="sect1">
+<h2 id="_name">Name</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>cowboy_req:stream_reply - Send the response headers</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_description">Description</h2>
+<div class="sectionbody">
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="font-weight: bold"><span style="color: #000000">stream_reply</span></span>(<span style="color: #009900">Status</span>, <span style="color: #009900">Req</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:req</span></span>())
+ <span style="color: #990000">-&gt;</span> <span style="font-weight: bold"><span style="color: #000000">stream_reply</span></span>(<span style="color: #009900">StatusCode</span>, #{}, <span style="color: #009900">Req</span>)
+
+<span style="font-weight: bold"><span style="color: #000000">stream_reply</span></span>(<span style="color: #009900">Status</span>, <span style="color: #009900">Headers</span>, <span style="color: #009900">Req</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:req</span></span>())
+ <span style="color: #990000">-&gt;</span> <span style="color: #009900">Req</span>
+
+<span style="color: #009900">Status</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000000">cowboy:http_status</span></span>()
+<span style="color: #009900">Headers</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000000">cowboy:http_headers</span></span>()</tt></pre></div></div>
+<div class="paragraph"><p>Send the response headers.</p></div>
+<div class="paragraph"><p>The header names must be given as lowercase binary strings.
+While header names are case insensitive, Cowboy requires them
+to be given as lowercase to function properly.</p></div>
+<div class="paragraph"><p>Cowboy does not allow duplicate header names. Headers set
+by this function may overwrite those set by <code>set_resp_header/3</code>.</p></div>
+<div class="paragraph"><p>Use <a href="../cowboy_req.set_resp_cookie">cowboy_req:set_resp_cookie(3)</a>
+instead of this function to set cookies.</p></div>
+<div class="paragraph"><p>If a response body was set before calling this function,
+it will not be sent.</p></div>
+<div class="paragraph"><p>Use <a href="../cowboy_req.stream_body">cowboy_req:stream_body(3)</a>
+to stream the response body.</p></div>
+<div class="paragraph"><p>You may want to set the content-length header when using
+this function, if it is known in advance. This will allow
+clients using HTTP/2 and HTTP/1.0 to process the response
+more efficiently.</p></div>
+<div class="paragraph"><p>The streaming method varies depending on the protocol being
+used. HTTP/2 will use the usual DATA frames. HTTP/1.1 will
+use chunked transfer-encoding. HTTP/1.0 will send the body
+unmodified and close the connection at the end if no
+content-length was set.</p></div>
+<div class="paragraph"><p>It is not possible to push resources after this function
+returns. Any attempt will result in an error.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_arguments">Arguments</h2>
+<div class="sectionbody">
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Status
+</dt>
+<dd>
+<p>
+The status code for the response.
+</p>
+</dd>
+<dt class="hdlist1">
+Headers
+</dt>
+<dd>
+<p>
+The response headers.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Header names must be given as lowercase binary strings.</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Req
+</dt>
+<dd>
+<p>
+The Req object.
+</p>
+</dd>
+</dl></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_return_value">Return value</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>A new Req object is returned.</p></div>
+<div class="paragraph"><p>The returned Req object must be used from that point onward
+in order to be able to stream the response body.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_changelog">Changelog</h2>
+<div class="sectionbody">
+<div class="ulist"><ul>
+<li>
+<p>
+<strong>2.0</strong>: Only the Req is returned, it is no longer wrapped in a tuple.
+</p>
+</li>
+<li>
+<p>
+<strong>2.0</strong>: Function introduced. Replaces <code>chunked_reply/1,2</code>.
+</p>
+</li>
+</ul></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_examples">Examples</h2>
+<div class="sectionbody">
+<div class="listingblock">
+<div class="title">Initiate the response</div>
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+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:stream_reply</span></span>(<span style="color: #993399">200</span>, <span style="color: #009900">Req0</span>)<span style="color: #990000">.</span></tt></pre></div></div>
+<div class="listingblock">
+<div class="title">Stream the response with custom headers</div>
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+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:stream_reply</span></span>(<span style="color: #993399">200</span>, #{
+ <span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"content-type"</span><span style="color: #990000">&gt;&gt;</span> <span style="color: #990000">=&gt;</span> <span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"text/plain"</span><span style="color: #990000">&gt;&gt;</span>
+}, <span style="color: #009900">Req0</span>),
+<span style="font-weight: bold"><span style="color: #000000">cowboy_req:stream_body</span></span>(<span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"Hello\n"</span><span style="color: #990000">&gt;&gt;</span>, <span style="color: #FF6600">nofin</span>, <span style="color: #009900">Req</span>),
+<span style="font-weight: bold"><span style="color: #000000">timer:sleep</span></span>(<span style="color: #993399">1000</span>),
+<span style="font-weight: bold"><span style="color: #000000">cowboy_req:stream_body</span></span>(<span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"World!\n"</span><span style="color: #990000">&gt;&gt;</span>, <span style="color: #FF6600">fin</span>, <span style="color: #009900">Req</span>)<span style="color: #990000">.</span></tt></pre></div></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_see_also">See also</h2>
+<div class="sectionbody">
+<div class="paragraph"><p><a href="../cowboy_req">cowboy_req(3)</a>,
+<a href="../cowboy_req.set_resp_cookie">cowboy_req:set_resp_cookie(3)</a>,
+<a href="../cowboy_req.set_resp_header">cowboy_req:set_resp_header(3)</a>,
+<a href="../cowboy_req.set_resp_headers">cowboy_req:set_resp_headers(3)</a>,
+<a href="../cowboy_req.reply">cowboy_req:reply(3)</a>,
+<a href="../cowboy_req.stream_body">cowboy_req:stream_body(3)</a>,
+<a href="../cowboy_req.push">cowboy_req:push(3)</a></p></div>
+</div>
+</div>