ocaml-opentelemetry/http/Http/Response/index.html
2025-07-23 14:08:20 +00:00

7 lines
6.8 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Response (http.Http.Response)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 3.1.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../../index.html">Index</a> &#x00BB; <a href="../../index.html">http</a> &#x00BB; <a href="../index.html">Http</a> &#x00BB; Response</nav><header class="odoc-preamble"><h1>Module <code><span>Http.Response</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = </span><span>{</span></code><ol><li id="type-t.headers" class="def record field anchored"><a href="#type-t.headers" class="anchor"></a><code><span>headers : <a href="../Header/index.html#type-t">Header.t</a>;</span></code><div class="def-doc"><span class="comment-delim">(*</span><p>response HTTP headers</p><span class="comment-delim">*)</span></div></li><li id="type-t.version" class="def record field anchored"><a href="#type-t.version" class="anchor"></a><code><span>version : <a href="../Version/index.html#type-t">Version.t</a>;</span></code><div class="def-doc"><span class="comment-delim">(*</span><p>(** HTTP version, usually 1.1 *)</p><span class="comment-delim">*)</span></div></li><li id="type-t.status" class="def record field anchored"><a href="#type-t.status" class="anchor"></a><code><span>status : <a href="../Status/index.html#type-t">Status.t</a>;</span></code><div class="def-doc"><span class="comment-delim">(*</span><p>HTTP status code of the response</p><span class="comment-delim">*)</span></div></li></ol><code><span>}</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-headers"><a href="#val-headers" class="anchor"></a><code><span><span class="keyword">val</span> headers : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../Header/index.html#type-t">Header.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-version"><a href="#val-version" class="anchor"></a><code><span><span class="keyword">val</span> version : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../Version/index.html#type-t">Version.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-status"><a href="#val-status" class="anchor"></a><code><span><span class="keyword">val</span> status : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../Status/index.html#type-t">Status.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-compare"><a href="#val-compare" class="anchor"></a><code><span><span class="keyword">val</span> compare : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> int</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-is_keep_alive"><a href="#val-is_keep_alive" class="anchor"></a><code><span><span class="keyword">val</span> is_keep_alive : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div><div class="spec-doc"><p>Return true whether the connection should be reused</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-requires_content_length"><a href="#val-requires_content_length" class="anchor"></a><code><span><span class="keyword">val</span> requires_content_length : <span><span class="optlabel">?request_meth</span>:<a href="../Method/index.html#type-t">Method.t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div><div class="spec-doc"><p><code>requires_content_length ~request_meth t</code> is <code>true</code> if a combination of <code>t</code> and <code>request_meth</code> indicates that a response message must include &quot;Content-Length&quot; header. However, please note exceptions to this:</p><ul><li>Response with status code of <code>304</code> may or may not include the header.</li><li>Response to request with method <code>HEAD</code> may or may not include the header.</li></ul><p>https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-content_length"><a href="#val-content_length" class="anchor"></a><code><span><span class="keyword">val</span> content_length : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>int option</span></span></code></div><div class="spec-doc"><p><code>content_length t</code> is <code>Some x</code> if the &quot;Content-Length&quot; header in <code>t</code> exists and its value <code>x</code> is a non negative integer, <code>x&gt;=0</code></p><p>It is <code>None</code> if <code>requires_content_length t = false</code> or the value encoded in &quot;Content-Length&quot; is not a valid integer value, i.e <code>&gt;= 0</code>.</p><p>See https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-make"><a href="#val-make" class="anchor"></a><code><span><span class="keyword">val</span> make :
<span><span class="optlabel">?version</span>:<a href="../Version/index.html#type-t">Version.t</a> <span class="arrow">&#45;&gt;</span></span>
<span><span class="optlabel">?status</span>:<a href="../Status/index.html#type-t">Status.t</a> <span class="arrow">&#45;&gt;</span></span>
<span><span class="optlabel">?headers</span>:<a href="../Header/index.html#type-t">Header.t</a> <span class="arrow">&#45;&gt;</span></span>
<span>unit <span class="arrow">&#45;&gt;</span></span>
<a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>make ()</code> is a value of <a href="#type-t"><code>t</code></a>. The default values for the request, if not specified, are: <code>status</code> is <code>`Ok</code>, <code>version</code> is <code>`HTTP_1_1</code>. The request encoding value is determined via the <code>Header.get_transfer_encoding</code> function.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span><span class="keyword">val</span> pp : <span><a href="../../../ocaml/Stdlib/Format/index.html#type-formatter">Stdlib.Format.formatter</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div></div></body></html>