diff options
Diffstat (limited to 'docs/en/cowboy/2.3/manual/cowboy_req.resp_header/index.html')
-rw-r--r-- | docs/en/cowboy/2.3/manual/cowboy_req.resp_header/index.html | 119 |
1 files changed, 32 insertions, 87 deletions
diff --git a/docs/en/cowboy/2.3/manual/cowboy_req.resp_header/index.html b/docs/en/cowboy/2.3/manual/cowboy_req.resp_header/index.html index 1c82f05d..cf70d271 100644 --- a/docs/en/cowboy/2.3/manual/cowboy_req.resp_header/index.html +++ b/docs/en/cowboy/2.3/manual/cowboy_req.resp_header/index.html @@ -62,113 +62,58 @@ <h1 class="lined-header"><span>cowboy_req:resp_header(3)</span></h1> -<div class="sect1"> <h2 id="_name">Name</h2> -<div class="sectionbody"> -<div class="paragraph"><p>cowboy_req:resp_header - Response header</p></div> -</div> -</div> -<div class="sect1"> +<p>cowboy_req:resp_header - Response header</p> <h2 id="_description">Description</h2> -<div class="sectionbody"> -<div class="listingblock"> -<div class="content"><!-- Generator: GNU source-highlight +<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">resp_header</span></span>(<span style="color: #009900">Name</span>, <span style="color: #009900">Req</span>) <span style="color: #990000">-></span> <span style="font-weight: bold"><span style="color: #000000">resp_header</span></span>(<span style="color: #009900">Name</span>, <span style="color: #009900">Req</span>, <span style="color: #000080">undefined</span>) -<span style="font-weight: bold"><span style="color: #000000">resp_header</span></span>(<span style="color: #009900">Name</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">Default</span>) <span style="color: #990000">-></span> <span style="font-weight: bold"><span style="color: #000080">binary</span></span>() | <span style="color: #009900">Default</span> - -<span style="color: #009900">Name</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000080">binary</span></span>() <span style="font-style: italic"><span style="color: #9A1900">%% lowercase; case insensitive</span></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: #009900">Default</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000000">any</span></span>()</tt></pre></div></div> -<div class="paragraph"><p>Return the value for the given response header.</p></div> -<div class="paragraph"><p>The response header must have been set previously using -<a href="../cowboy_req.set_resp_header">cowboy_req:set_resp_header(3)</a> or -<a href="../cowboy_req.set_resp_headers">cowboy_req:set_resp_headers(3)</a>.</p></div> -<div class="paragraph"><p>The header name must be given as a lowercase binary string. -While header names are case insensitive, Cowboy requires them -to be given as lowercase to function properly.</p></div> -</div> -</div> -<div class="sect1"> +<pre><tt><b><font color="#000000">resp_header</font></b>(<font color="#009900">Name</font>, <font color="#009900">Req</font>) <font color="#990000">-></font> <b><font color="#000000">resp_header</font></b>(<font color="#009900">Name</font>, <font color="#009900">Req</font>, <font color="#000080">undefined</font>) +<b><font color="#000000">resp_header</font></b>(<font color="#009900">Name</font>, <font color="#009900">Req</font>, <font color="#009900">Default</font>) <font color="#990000">-></font> <b><font color="#000080">binary</font></b>() | <font color="#009900">Default</font> + +<font color="#009900">Name</font> <font color="#990000">::</font> <b><font color="#000080">binary</font></b>() <i><font color="#9A1900">%% lowercase; case insensitive</font></i> +<font color="#009900">Req</font> <font color="#990000">::</font> <b><font color="#000000">cowboy_req:req</font></b>() +<font color="#009900">Default</font> <font color="#990000">::</font> <b><font color="#000000">any</font></b>()</tt></pre> +</div></div> +<p>Return the value for the given response header.</p> +<p>The response header must have been set previously using <a href="../cowboy_req.set_resp_header">cowboy_req:set_resp_header(3)</a> or <a href="../cowboy_req.set_resp_headers">cowboy_req:set_resp_headers(3)</a>.</p> +<p>The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly.</p> <h2 id="_arguments">Arguments</h2> -<div class="sectionbody"> -<div class="dlist"><dl> -<dt class="hdlist1"> -Name -</dt> -<dd> -<p> -Desired response header name as a lowercase binary string. -</p> +<dl><dt>Name</dt> +<dd><p>Desired response header name as a lowercase binary string.</p> </dd> -<dt class="hdlist1"> -Req -</dt> -<dd> -<p> -The Req object. -</p> +<dt>Req</dt> +<dd><p>The Req object.</p> </dd> -<dt class="hdlist1"> -Default -</dt> -<dd> -<p> -Default value returned when the header is missing. -</p> +<dt>Default</dt> +<dd><p>Default value returned when the header is missing.</p> </dd> -</dl></div> -</div> -</div> -<div class="sect1"> +</dl> <h2 id="_return_value">Return value</h2> -<div class="sectionbody"> -<div class="paragraph"><p>The header value is returned as a binary string. When the -header is missing, the default argument is returned.</p></div> -</div> -</div> -<div class="sect1"> +<p>The header value is returned as a binary string. When the header is missing, the default argument is returned.</p> <h2 id="_changelog">Changelog</h2> -<div class="sectionbody"> -<div class="ulist"><ul> -<li> -<p> -<strong>2.0</strong>: Function introduced. -</p> +<ul><li><strong>2.0</strong>: Function introduced. </li> -</ul></div> -</div> -</div> -<div class="sect1"> +</ul> <h2 id="_examples">Examples</h2> -<div class="sectionbody"> -<div class="listingblock"> -<div class="title">Get the content-type response header</div> -<div class="content"><!-- Generator: GNU source-highlight +<div class="listingblock"><div class="title">Get the content-type response header</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">Type</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:resp_header</span></span>(<span style="color: #990000"><<</span><span style="color: #FF0000">"content-type"</span><span style="color: #990000">>></span>, <span style="color: #009900">Req</span>)<span style="color: #990000">.</span></tt></pre></div></div> -<div class="listingblock"> -<div class="title">Get the content-type response header with a default value</div> -<div class="content"><!-- Generator: GNU source-highlight +<pre><tt><font color="#009900">Type</font> <font color="#990000">=</font> <b><font color="#000000">cowboy_req:resp_header</font></b>(<font color="#990000"><<</font><font color="#FF0000">"content-type"</font><font color="#990000">>></font>, <font color="#009900">Req</font>)<font color="#990000">.</font></tt></pre> +</div></div> +<div class="listingblock"><div class="title">Get the content-type response header with a default value</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">Type</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:resp_header</span></span>(<span style="color: #990000"><<</span><span style="color: #FF0000">"content-type"</span><span style="color: #990000">>></span>, <span style="color: #009900">Req</span>, <span style="color: #990000"><<</span><span style="color: #FF0000">"text/html"</span><span style="color: #990000">>></span>)<span style="color: #990000">.</span></tt></pre></div></div> -</div> -</div> -<div class="sect1"> +<pre><tt><font color="#009900">Type</font> <font color="#990000">=</font> <b><font color="#000000">cowboy_req:resp_header</font></b>(<font color="#990000"><<</font><font color="#FF0000">"content-type"</font><font color="#990000">>></font>, <font color="#009900">Req</font>, <font color="#990000"><<</font><font color="#FF0000">"text/html"</font><font color="#990000">>></font>)<font color="#990000">.</font></tt></pre> +</div></div> <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.resp_headers">cowboy_req:resp_headers(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></p></div> -</div> -</div> +<p><a href="../cowboy_req">cowboy_req(3)</a>, <a href="../cowboy_req.resp_headers">cowboy_req:resp_headers(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></p> + |