Skip to content

Commit

Permalink
upgrade to reparse v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bikallem committed Apr 7, 2021
1 parent 0f1b5dc commit d1f2b9a
Show file tree
Hide file tree
Showing 9 changed files with 285 additions and 271 deletions.
4 changes: 2 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## v1.1.0 2021-01-14
## v1.1.0 2021-04-07

- Ensure compatibility with reparse v3.0.0
- Ensure compatibility with reparse v2.1.0

## v1.0.1 2020-04-12

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Part (http-multipart-formdata.Http_multipart_formdata.Part)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a><a href="../../index.html">http-multipart-formdata</a> &#x00BB; <a href="../index.html">Http_multipart_formdata</a> &#x00BB; Part</nav><h1>Module <code>Http_multipart_formdata.Part</code></h1><p>Represents a parsed multipart part. A part corresponds to a submitted form field data in a HTTP request.</p></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = </code><code>{</code><table class="record"><tr id="type-t.body" class="anchored"><td class="def field"><a href="#type-t.body" class="anchor"></a><code>body : bytes;</code></td><td class="doc"><p>Body content</p></td></tr><tr id="type-t.name" class="anchored"><td class="def field"><a href="#type-t.name" class="anchor"></a><code>name : string;</code></td><td class="doc"><p>Name of the part - form field name</p></td></tr><tr id="type-t.content_type" class="anchored"><td class="def field"><a href="#type-t.content_type" class="anchor"></a><code>content_type : string;</code></td><td class="doc"><p>HTTP content type of the part <code>body</code>. &quot;text/plain&quot; is default</p></td></tr><tr id="type-t.filename" class="anchored"><td class="def field"><a href="#type-t.filename" class="anchor"></a><code>filename : <span>string option</span>;</code></td><td class="doc"><p><code>filename</code> form field attribute.</p></td></tr><tr id="type-t.parameters" class="anchored"><td class="def field"><a href="#type-t.parameters" class="anchor"></a><code>parameters : <span>string <a href="../index.html#module-Map">Map</a>.t</span>;</code></td><td class="doc"><p>Additional <code>key = value</code> params of the form field.</p></td></tr></table><code>}</code></dt></dl><dl><dt class="spec value" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span class="keyword">val</span> pp : Stdlib.Format.formatter <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dd><p><code>pp fmt part</code> is the pretty printer for <code>t</code>.</p></dd></dl><dl><dt class="spec value" id="val-equal"><a href="#val-equal" class="anchor"></a><code><span class="keyword">val</span> equal : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> bool</code></dt><dd><p><code>equal part1 part2</code> returns <code>true</code> if <code>part1</code> and <code>part2</code> are equal.</p></dd></dl></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Part (http-multipart-formdata.Http_multipart_formdata.Part)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.0.0-beta2-97-gcb4f04e2"/><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">http-multipart-formdata</a> &#x00BB; <a href="../index.html">Http_multipart_formdata</a> &#x00BB; Part</nav><header class="odoc-preamble"><h1>Module <code><span>Http_multipart_formdata.Part</span></code></h1><p>Represents a parsed multipart part. A part corresponds to a submitted form field data in a HTTP request.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type" id="type-t" class="anchored"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = </span><span>{</span></code><table><tr id="type-t.body" class="anchored"><td class="def record field"><a href="#type-t.body" class="anchor"></a><code><span>body : bytes;</span></code></td><td class="def-doc"><span class="comment-delim">(*</span><p>Body content</p><span class="comment-delim">*)</span></td></tr><tr id="type-t.name" class="anchored"><td class="def record field"><a href="#type-t.name" class="anchor"></a><code><span>name : string;</span></code></td><td class="def-doc"><span class="comment-delim">(*</span><p>Name of the part - form field name</p><span class="comment-delim">*)</span></td></tr><tr id="type-t.content_type" class="anchored"><td class="def record field"><a href="#type-t.content_type" class="anchor"></a><code><span>content_type : string;</span></code></td><td class="def-doc"><span class="comment-delim">(*</span><p>HTTP content type of the part <code>body</code>. &quot;text/plain&quot; is default</p><span class="comment-delim">*)</span></td></tr><tr id="type-t.filename" class="anchored"><td class="def record field"><a href="#type-t.filename" class="anchor"></a><code><span>filename : <span>string option</span>;</span></code></td><td class="def-doc"><span class="comment-delim">(*</span><p><code>filename</code> form field attribute.</p><span class="comment-delim">*)</span></td></tr><tr id="type-t.parameters" class="anchored"><td class="def record field"><a href="#type-t.parameters" class="anchor"></a><code><span>parameters : <span>string <span class="xref-unresolved">Map</span>.t</span>;</span></code></td><td class="def-doc"><span class="comment-delim">(*</span><p>Additional <code>key = value</code> params of the form field.</p><span class="comment-delim">*)</span></td></tr></table><code><span>}</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-pp" class="anchored"><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">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>pp fmt part</code> is the pretty printer for <code>t</code>.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-equal" class="anchored"><a href="#val-equal" class="anchor"></a><code><span><span class="keyword">val</span> equal : <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> bool</span></code></div><div class="spec-doc"><p><code>equal part1 part2</code> returns <code>true</code> if <code>part1</code> and <code>part2</code> are equal.</p></div></div></div></body></html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Http_multipart_formdata (http-multipart-formdata.Http_multipart_formdata)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a><a href="../index.html">http-multipart-formdata</a> &#x00BB; Http_multipart_formdata</nav><h1>Module <code>Http_multipart_formdata</code></h1><h3 id="types"><a href="#types" class="anchor"></a>Types</h3><nav class="toc"><ul><li><a href="#parse">Parse</a></li><li><a href="#pretty-printers">Pretty Printers</a></li><li><a href="#equals">Equals</a></li></ul></nav></header><dl><dt class="spec module" id="module-Map"><a href="#module-Map" class="anchor"></a><code><span class="keyword">module</span> Map : Stdlib.Map.S <span class="keyword">with</span> <span class="keyword">type</span> <a href="index.html#module-Map">Map</a>.key = string</code></dt><dd><p>An ocaml <code>Stdlib</code> Map with <code>string</code> as key.</p></dd></dl><dl><dt class="spec module" id="module-Part"><a href="#module-Part" class="anchor"></a><code><span class="keyword">module</span> <a href="Part/index.html">Part</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd><p>Represents a parsed multipart part. A part corresponds to a submitted form field data in a HTTP request.</p></dd></dl><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = <span><span><a href="Part/index.html#type-t">Part.t</a> list</span> <a href="index.html#module-Map">Map</a>.t</span></code></dt><dd><p>Represents a parsed HTTP <code>multipart/form-data</code> request as a <code>key/value</code> map. Submitted form field name is the key value.</p><p>A key may be associated in zero or more values.</p></dd></dl><dl><dt class="spec exception" id="exception-Multipart"><a href="#exception-Multipart" class="anchor"></a><code><span class="keyword">exception</span> </code><code><span class="exception">Multipart</span> <span class="keyword">of</span> string</code></dt><dd><p>Represents error while parsing http multipart formdata.</p></dd></dl><section><header><h3 id="parse"><a href="#parse" class="anchor"></a>Parse</h3></header><dl><dt class="spec value" id="val-parse"><a href="#val-parse" class="anchor"></a><code><span class="keyword">val</span> parse : <span>content_type_header:string</span> <span>&#45;&gt;</span> <span>body:string</span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p><code>parse ~content_type_header ~body</code> returns a parsed HTTP multiparts such that it can be queried using ocaml <code>Stdlib.Map</code> functions.</p><p><code>content_type_header</code> is the HTTP request <code>Content-Type</code> header. Note the value contains both the header name and value. It is used to parse a <code>boundary</code> value.</p><p><code>body</code> is the raw HTTP POST request body content.</p><h5 id="examples"><a href="#examples" class="anchor"></a>Examples</h5><pre><code class="ml">module M = Http_multipart_formdata
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Http_multipart_formdata (http-multipart-formdata.Http_multipart_formdata)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.0.0-beta2-97-gcb4f04e2"/><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">http-multipart-formdata</a> &#x00BB; Http_multipart_formdata</nav><header class="odoc-preamble"><h1>Module <code><span>Http_multipart_formdata</span></code></h1></header><nav class="odoc-toc"><ul><li><a href="#types">Types</a></li><li><a href="#parse">Parse</a></li><li><a href="#pretty-printers">Pretty Printers</a></li><li><a href="#equals">Equals</a></li></ul></nav><div class="odoc-content"><h3 id="types"><a href="#types" class="anchor"></a>Types</h3><div class="odoc-spec"><div class="spec module" id="module-Map" class="anchored"><a href="#module-Map" class="anchor"></a><code><span><span class="keyword">module</span> </span><span>Map</span><span> : <span class="xref-unresolved">Stdlib</span>.Map.S <span class="keyword">with</span> <span><span class="keyword">type</span> <span class="xref-unresolved">key</span> = <span class="xref-unresolved">string</span></span></span></code></div><div class="spec-doc"><p>An ocaml <code>Stdlib</code> Map with <code>string</code> as key.</p></div></div><div class="odoc-spec"><div class="spec module" id="module-Part" class="anchored"><a href="#module-Part" class="anchor"></a><code><span><span class="keyword">module</span> </span><span><a href="Part/index.html">Part</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Represents a parsed multipart part. A part corresponds to a submitted form field data in a HTTP request.</p></div></div><div class="odoc-spec"><div class="spec type" id="type-t" class="anchored"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = <span><span><a href="Part/index.html#type-t">Part.t</a> list</span> <span class="xref-unresolved">Map</span>.t</span></span></code></div><div class="spec-doc"><p>Represents a parsed HTTP <code>multipart/form-data</code> request as a <code>key/value</code> map. Submitted form field name is the key value.</p><p>A key may be associated in zero or more values.</p></div></div><div class="odoc-spec"><div class="spec exception" id="exception-Multipart" class="anchored"><a href="#exception-Multipart" class="anchor"></a><code><span><span class="keyword">exception</span> </span><span><span class="exception">Multipart</span> <span class="keyword">of</span> string</span></code></div><div class="spec-doc"><p>Represents error while parsing http multipart formdata.</p></div></div><h3 id="parse"><a href="#parse" class="anchor"></a>Parse</h3><div class="odoc-spec"><div class="spec value" id="val-parse" class="anchored"><a href="#val-parse" class="anchor"></a><code><span><span class="keyword">val</span> parse : <span>content_type_header:string <span class="arrow">&#45;&gt;</span></span> <span>body:string <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>parse ~content_type_header ~body</code> returns a parsed HTTP multiparts such that it can be queried using ocaml <code>Stdlib.Map</code> functions.</p><p><code>content_type_header</code> is the HTTP request <code>Content-Type</code> header. Note the value contains both the header name and value. It is used to parse a <code>boundary</code> value.</p><p><code>body</code> is the raw HTTP POST request body content.</p><p>Examples</p><pre><code>module M = Http_multipart_formdata

;;
let content_type_header =
Expand Down Expand Up @@ -48,4 +48,4 @@
}
]
in
M.equal_parts file1_1 file1_2</code></pre><dl><dt>raises Multipart</dt><dd></dd></dl></dd></dl></section><section><header><h3 id="pretty-printers"><a href="#pretty-printers" class="anchor"></a>Pretty Printers</h3></header><dl><dt class="spec value" id="val-pp_parts"><a href="#val-pp_parts" class="anchor"></a><code><span class="keyword">val</span> pp_parts : Stdlib.Format.formatter <span>&#45;&gt;</span> <span><a href="Part/index.html#type-t">Part.t</a> list</span> <span>&#45;&gt;</span> unit</code></dt><dd><p><code>pp_parts fmt parts</code> pretty prints a list of <code>Part.t</code></p></dd></dl><dl><dt class="spec value" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span class="keyword">val</span> pp : Stdlib.Format.formatter <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dd><p><code>pp fmt part</code> pretty prints a <code>part</code>.</p></dd></dl></section><section><header><h3 id="equals"><a href="#equals" class="anchor"></a>Equals</h3></header><dl><dt class="spec value" id="val-equal_parts"><a href="#val-equal_parts" class="anchor"></a><code><span class="keyword">val</span> equal_parts : <span><a href="Part/index.html#type-t">Part.t</a> list</span> <span>&#45;&gt;</span> <span><a href="Part/index.html#type-t">Part.t</a> list</span> <span>&#45;&gt;</span> bool</code></dt><dd><p><code>equal_parts parts1 parts2</code> returns <code>true</code> if <code>parts1</code> and <code>parts2</code> are equal, <code>false</code> otherwise.</p></dd></dl><dl><dt class="spec value" id="val-equal"><a href="#val-equal" class="anchor"></a><code><span class="keyword">val</span> equal : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> bool</code></dt><dd><p><code>equal t1 t2</code> returns <code>true</code> if <code>Part.</code> <code>t1</code> and <code>t2</code> are equal, <code>false</code> otherwise.</p></dd></dl></section></div></body></html>
M.equal_parts file1_1 file1_2</code></pre><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <span class="value">Multipart</span> </li></ul></div></div><h3 id="pretty-printers"><a href="#pretty-printers" class="anchor"></a>Pretty Printers</h3><div class="odoc-spec"><div class="spec value" id="val-pp_parts" class="anchored"><a href="#val-pp_parts" class="anchor"></a><code><span><span class="keyword">val</span> pp_parts : <span><span class="xref-unresolved">Stdlib</span>.Format.formatter <span class="arrow">&#45;&gt;</span></span> <span><span><a href="Part/index.html#type-t">Part.t</a> list</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>pp_parts fmt parts</code> pretty prints a list of <code>Part.t</code></p></div></div><div class="odoc-spec"><div class="spec value" id="val-pp" class="anchored"><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">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>pp fmt part</code> pretty prints a <code>part</code>.</p></div></div><h3 id="equals"><a href="#equals" class="anchor"></a>Equals</h3><div class="odoc-spec"><div class="spec value" id="val-equal_parts" class="anchored"><a href="#val-equal_parts" class="anchor"></a><code><span><span class="keyword">val</span> equal_parts : <span><span><a href="Part/index.html#type-t">Part.t</a> list</span> <span class="arrow">&#45;&gt;</span></span> <span><span><a href="Part/index.html#type-t">Part.t</a> list</span> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div><div class="spec-doc"><p><code>equal_parts parts1 parts2</code> returns <code>true</code> if <code>parts1</code> and <code>parts2</code> are equal, <code>false</code> otherwise.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-equal" class="anchored"><a href="#val-equal" class="anchor"></a><code><span><span class="keyword">val</span> equal : <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> bool</span></code></div><div class="spec-doc"><p><code>equal t1 t2</code> returns <code>true</code> if <code>Part.</code> <code>t1</code> and <code>t2</code> are equal, <code>false</code> otherwise.</p></div></div></div></body></html>
Loading

0 comments on commit d1f2b9a

Please sign in to comment.