mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-07 19:55:36 -05:00
deploy: 163d720641
This commit is contained in:
parent
80256f4930
commit
89602232b3
10 changed files with 19 additions and 19 deletions
File diff suppressed because one or more lines are too long
|
|
@ -1,2 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Headers (tiny_httpd.Tiny_httpd_server.Headers)</title><link rel="stylesheet" href="../../../_odoc_support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../_odoc_support/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">tiny_httpd</a> » <a href="../index.html">Tiny_httpd_server</a> » Headers</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_server.Headers</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>(string * string)</span> list</span></span></code></div><div class="spec-doc"><p>The header files of a request or response.</p><p>Neither the key nor the value can contain <code>'\r'</code> or <code>'\n'</code>. See https://tools.ietf.org/html/rfc7230#section-3.2</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-empty"><a href="#val-empty" class="anchor"></a><code><span><span class="keyword">val</span> empty : <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Empty list of headers</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get"><a href="#val-get" class="anchor"></a><code><span><span class="keyword">val</span> get : <span>?f:<span>(<span>string <span class="arrow">-></span></span> string)</span> <span class="arrow">-></span></span> <span>string <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span>string option</span></span></code></div><div class="spec-doc"><p><code>get k headers</code> looks for the header field with key <code>k</code>.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">f</span> <p>if provided, will transform the value before it is returned.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set"><a href="#val-set" class="anchor"></a><code><span><span class="keyword">val</span> set : <span>string <span class="arrow">-></span></span> <span>string <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>set k v headers</code> sets the key <code>k</code> to value <code>v</code>. It erases any previous entry for <code>k</code></p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-remove"><a href="#val-remove" class="anchor"></a><code><span><span class="keyword">val</span> remove : <span>string <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Remove the key from the headers, if present.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-contains"><a href="#val-contains" class="anchor"></a><code><span><span class="keyword">val</span> contains : <span>string <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></span></span> bool</span></code></div><div class="spec-doc"><p>Is there a header with the given key?</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><span class="xref-unresolved">Stdlib</span>.Format.formatter <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p>Pretty print the headers.</p></div></div></div></body></html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Headers (tiny_httpd.Tiny_httpd_server.Headers)</title><link rel="stylesheet" href="../../../_odoc_support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../_odoc_support/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">tiny_httpd</a> » <a href="../index.html">Tiny_httpd_server</a> » Headers</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_server.Headers</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>(string * string)</span> list</span></span></code></div><div class="spec-doc"><p>The header files of a request or response.</p><p>Neither the key nor the value can contain <code>'\r'</code> or <code>'\n'</code>. See https://tools.ietf.org/html/rfc7230#section-3.2</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-empty"><a href="#val-empty" class="anchor"></a><code><span><span class="keyword">val</span> empty : <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Empty list of headers.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get"><a href="#val-get" class="anchor"></a><code><span><span class="keyword">val</span> get : <span>?f:<span>(<span>string <span class="arrow">-></span></span> string)</span> <span class="arrow">-></span></span> <span>string <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span>string option</span></span></code></div><div class="spec-doc"><p><code>get k headers</code> looks for the header field with key <code>k</code>.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">f</span> <p>if provided, will transform the value before it is returned.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set"><a href="#val-set" class="anchor"></a><code><span><span class="keyword">val</span> set : <span>string <span class="arrow">-></span></span> <span>string <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>set k v headers</code> sets the key <code>k</code> to value <code>v</code>. It erases any previous entry for <code>k</code></p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-remove"><a href="#val-remove" class="anchor"></a><code><span><span class="keyword">val</span> remove : <span>string <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Remove the key from the headers, if present.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-contains"><a href="#val-contains" class="anchor"></a><code><span><span class="keyword">val</span> contains : <span>string <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></span></span> bool</span></code></div><div class="spec-doc"><p>Is there a header with the given key?</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><span class="xref-unresolved">Stdlib</span>.Format.formatter <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p>Pretty print the headers.</p></div></div></div></body></html>
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Middleware (tiny_httpd.Tiny_httpd_server.Middleware)</title><link rel="stylesheet" href="../../../_odoc_support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../_odoc_support/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">tiny_httpd</a> » <a href="../index.html">Tiny_httpd_server</a> » Middleware</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_server.Middleware</span></code></h1></header><nav class="odoc-toc"><ul><li><a href="#middlewares">Middlewares</a></li></ul></nav><div class="odoc-content"><h3 id="middlewares"><a href="#middlewares" class="anchor"></a>Middlewares</h3><p>A middleware can be inserted in a handler to modify or observe its behavior.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.11</li></ul><div class="odoc-spec"><div class="spec type anchored" id="type-handler"><a href="#type-handler" class="anchor"></a><code><span><span class="keyword">type</span> handler</span><span> = <span><span><a href="../index.html#type-byte_stream">byte_stream</a> <a href="../Request/index.html#type-t">Request.t</a></span> <span class="arrow">-></span></span> <span>resp:<span>(<span><a href="../Response/index.html#type-t">Response.t</a> <span class="arrow">-></span></span> unit)</span> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p>Handlers are functions returning a response to a request. The response can be delayed, hence the use of a continuation as the <code>resp</code> parameter.</p></div></div><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><a href="#type-handler">handler</a> <span class="arrow">-></span></span> <a href="#type-handler">handler</a></span></code></div><div class="spec-doc"><p>A middleware is a handler transformation.</p><p>It takes the existing handler <code>h</code>, and returns a new one which, given a query, modify it or log it before passing it to <code>h</code>, or fail. It can also log or modify or drop the response.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-nil"><a href="#val-nil" class="anchor"></a><code><span><span class="keyword">val</span> nil : <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Trivial middleware that does nothing.</p></div></div></div></body></html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Middleware (tiny_httpd.Tiny_httpd_server.Middleware)</title><link rel="stylesheet" href="../../../_odoc_support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../_odoc_support/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">tiny_httpd</a> » <a href="../index.html">Tiny_httpd_server</a> » Middleware</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_server.Middleware</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-handler"><a href="#type-handler" class="anchor"></a><code><span><span class="keyword">type</span> handler</span><span> = <span><span><a href="../index.html#type-byte_stream">byte_stream</a> <a href="../Request/index.html#type-t">Request.t</a></span> <span class="arrow">-></span></span> <span>resp:<span>(<span><a href="../Response/index.html#type-t">Response.t</a> <span class="arrow">-></span></span> unit)</span> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p>Handlers are functions returning a response to a request. The response can be delayed, hence the use of a continuation as the <code>resp</code> parameter.</p></div></div><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><a href="#type-handler">handler</a> <span class="arrow">-></span></span> <a href="#type-handler">handler</a></span></code></div><div class="spec-doc"><p>A middleware is a handler transformation.</p><p>It takes the existing handler <code>h</code>, and returns a new one which, given a query, modify it or log it before passing it to <code>h</code>, or fail. It can also log or modify or drop the response.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-nil"><a href="#val-nil" class="anchor"></a><code><span><span class="keyword">val</span> nil : <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Trivial middleware that does nothing.</p></div></div></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,2 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (tiny_httpd.index)</title><link rel="stylesheet" href="../_odoc_support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../_odoc_support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – tiny_httpd</nav><header class="odoc-preamble"><h1 id="tiny_httpd-index"><a href="#tiny_httpd-index" class="anchor"></a>tiny_httpd index</h1></header><nav class="odoc-toc"><ul><li><a href="#library-tiny_httpd">Library tiny_httpd</a></li></ul></nav><div class="odoc-content"><h2 id="library-tiny_httpd"><a href="#library-tiny_httpd" class="anchor"></a>Library tiny_httpd</h2><p>This library exposes the following toplevel modules:</p><ul class="modules"><li><a href="Tiny_httpd/index.html"><code>Tiny_httpd</code></a> </li><li><a href="Tiny_httpd_buf/index.html"><code>Tiny_httpd_buf</code></a> <span class="synopsis">Simple buffer.</span></li><li><a href="Tiny_httpd_dir/index.html"><code>Tiny_httpd_dir</code></a> <span class="synopsis">Serving static content from directories</span></li><li><a href="Tiny_httpd_html/index.html"><code>Tiny_httpd_html</code></a> <span class="synopsis">HTML combinators.</span></li><li><a href="Tiny_httpd_html_/index.html"><code>Tiny_httpd_html_</code></a> </li><li><a href="Tiny_httpd_server/index.html"><code>Tiny_httpd_server</code></a> <span class="synopsis">HTTP server.</span></li><li><a href="Tiny_httpd_stream/index.html"><code>Tiny_httpd_stream</code></a> <span class="synopsis">Byte streams.</span></li><li><a href="Tiny_httpd_util/index.html"><code>Tiny_httpd_util</code></a> </li></ul></div></body></html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (tiny_httpd.index)</title><link rel="stylesheet" href="../_odoc_support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../_odoc_support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – tiny_httpd</nav><header class="odoc-preamble"><h1 id="tiny_httpd-index"><a href="#tiny_httpd-index" class="anchor"></a>tiny_httpd index</h1></header><nav class="odoc-toc"><ul><li><a href="#library-tiny_httpd">Library tiny_httpd</a></li></ul></nav><div class="odoc-content"><h2 id="library-tiny_httpd"><a href="#library-tiny_httpd" class="anchor"></a>Library tiny_httpd</h2><p>This library exposes the following toplevel modules:</p><ul class="modules"><li><a href="Tiny_httpd/index.html"><code>Tiny_httpd</code></a> <span class="synopsis">Tiny Http Server</span></li><li><a href="Tiny_httpd_buf/index.html"><code>Tiny_httpd_buf</code></a> <span class="synopsis">Simple buffer.</span></li><li><a href="Tiny_httpd_dir/index.html"><code>Tiny_httpd_dir</code></a> <span class="synopsis">Serving static content from directories</span></li><li><a href="Tiny_httpd_html/index.html"><code>Tiny_httpd_html</code></a> <span class="synopsis">HTML combinators.</span></li><li><a href="Tiny_httpd_html_/index.html"><code>Tiny_httpd_html_</code></a> </li><li><a href="Tiny_httpd_server/index.html"><code>Tiny_httpd_server</code></a> <span class="synopsis">HTTP server.</span></li><li><a href="Tiny_httpd_stream/index.html"><code>Tiny_httpd_stream</code></a> <span class="synopsis">Byte streams.</span></li><li><a href="Tiny_httpd_util/index.html"><code>Tiny_httpd_util</code></a> </li></ul></div></body></html>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Tiny_httpd_camlzip (tiny_httpd_camlzip.Tiny_httpd_camlzip)</title><link rel="stylesheet" href="../../_odoc_support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../_odoc_support/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">tiny_httpd_camlzip</a> » Tiny_httpd_camlzip</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_camlzip</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-middleware"><a href="#val-middleware" class="anchor"></a><code><span><span class="keyword">val</span> middleware :
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Tiny_httpd_camlzip (tiny_httpd_camlzip.Tiny_httpd_camlzip)</title><link rel="stylesheet" href="../../_odoc_support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../_odoc_support/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">tiny_httpd_camlzip</a> » Tiny_httpd_camlzip</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_camlzip</span></code></h1><p>Middleware for compression.</p><p>This uses camlzip to provide deflate compression/decompression. If installed, the middleware will compress responses' bodies when they are streams or fixed-size above a given limit (but it will not compress small, fixed-size bodies).</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-middleware"><a href="#val-middleware" class="anchor"></a><code><span><span class="keyword">val</span> middleware :
|
||||
<span>?compress_above:int <span class="arrow">-></span></span>
|
||||
<span>?buf_size:int <span class="arrow">-></span></span>
|
||||
<span>unit <span class="arrow">-></span></span>
|
||||
<a href="../../tiny_httpd/Tiny_httpd_server/Middleware/index.html#type-t">Tiny_httpd_server.Middleware.t</a></span></code></div><div class="spec-doc"><p>Middleware responsible for deflate compression/decompression.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.11</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-setup"><a href="#val-setup" class="anchor"></a><code><span><span class="keyword">val</span> setup : <span>?compress_above:int <span class="arrow">-></span></span> <span>?buf_size:int <span class="arrow">-></span></span> <span><a href="../../tiny_httpd/Tiny_httpd_server/index.html#type-t">Tiny_httpd_server.t</a> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p>Install middleware for tiny_httpd to be able to encode/decode compressed streams</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">compress_above</span> <p>threshold above with string responses are compressed</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">buf_size</span> <p>size of the underlying buffer for compression/decompression</p></li></ul></div></div></div></body></html>
|
||||
<a href="../../tiny_httpd/Tiny_httpd_server/Middleware/index.html#type-t">Tiny_httpd_server.Middleware.t</a></span></code></div><div class="spec-doc"><p>Middleware responsible for deflate compression/decompression.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">compress_above</span> <p>threshold, in bytes, above which a response body that has a known content-length is compressed. Stream bodies are always compressed.</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">buf_size</span> <p>size of the underlying buffer for compression/decompression</p></li></ul><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.11</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-setup"><a href="#val-setup" class="anchor"></a><code><span><span class="keyword">val</span> setup : <span>?compress_above:int <span class="arrow">-></span></span> <span>?buf_size:int <span class="arrow">-></span></span> <span><a href="../../tiny_httpd/Tiny_httpd_server/index.html#type-t">Tiny_httpd_server.t</a> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p>Install middleware for tiny_httpd to be able to encode/decode compressed streams</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">compress_above</span> <p>threshold above with string responses are compressed</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">buf_size</span> <p>size of the underlying buffer for compression/decompression</p></li></ul></div></div></div></body></html>
|
||||
Loading…
Add table
Reference in a new issue