<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Make (http-multipart-formdata.Http_multipart_formdata.Make)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.0.0-beta4-56-gda5986d7"/><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; Make</nav><header class="odoc-preamble"><h1>Module <code><span>Http_multipart_formdata.Make</span></code></h1></header><nav class="odoc-toc"><ul><li><a href="#types">Types</a></li><li><a href="#parameters">Parameters</a></li><li><a href="#signature">Signature</a><ul><li><a href="#multipart-reader">Multipart Reader</a></li><li><a href="#part-header">Part header</a></li><li><a href="#pretty-printers">Pretty Printers</a></li></ul></li></ul></nav><div class="odoc-content"><h3 id="types"><a href="#types" class="anchor"></a>Types</h3><h2 id="parameters"><a href="#parameters" class="anchor"></a>Parameters</h2><div class="odoc-spec"><div class="spec parameter" id="argument-1-P" class="anchored"><a href="#argument-1-P" class="anchor"></a><code><span><span class="keyword">module</span> </span><span>P</span><span> : <span class="xref-unresolved">Reparse</span>.PARSER</span></code></div></div><h2 id="signature"><a href="#signature" class="anchor"></a>Signature</h2><div class="odoc-spec"><div class="spec type" id="type-input" class="anchored"><a href="#type-input" class="anchor"></a><code><span><span class="keyword">type</span> input</span><span> = <span class="xref-unresolved">P</span>.input</span></code></div></div><div class="odoc-spec"><div class="spec type" id="type-promise" class="anchored"><a href="#type-promise" class="anchor"></a><code><span><span class="keyword">and</span> <span>'a promise</span></span><span> = <span><span class="type-var">'a</span> <span class="xref-unresolved">P</span>.promise</span></span></code></div></div><div class="odoc-spec"><div class="spec type" id="type-reader" class="anchored"><a href="#type-reader" class="anchor"></a><code><span><span class="keyword">and</span> reader</span></code></div></div><div class="odoc-spec"><div class="spec type" id="type-read_result" class="anchored"><a href="#type-read_result" class="anchor"></a><code><span><span class="keyword">and</span> read_result</span><span> = </span><span>[ </span></code><table><tr id="type-read_result.End" class="anchored"><td class="def constructor"><a href="#type-read_result.End" class="anchor"></a><code><span>| </span></code><code><span>`End</span></code></td></tr><tr id="type-read_result.Header" class="anchored"><td class="def constructor"><a href="#type-read_result.Header" class="anchor"></a><code><span>| </span></code><code><span>`Header <span class="keyword">of</span> <a href="#type-part_header">part_header</a></span></code></td></tr><tr id="type-read_result.Body" class="anchored"><td class="def constructor"><a href="#type-read_result.Body" class="anchor"></a><code><span>| </span></code><code><span>`Body <span class="keyword">of</span> <span class="xref-unresolved">Cstruct</span>.t</span></code></td></tr><tr id="type-read_result.Body_end" class="anchored"><td class="def constructor"><a href="#type-read_result.Body_end" class="anchor"></a><code><span>| </span></code><code><span>`Body_end</span></code></td></tr><tr id="type-read_result.Error" class="anchored"><td class="def constructor"><a href="#type-read_result.Error" class="anchor"></a><code><span>| </span></code><code><span>`Error <span class="keyword">of</span> string</span></code></td></tr></table><code><span> ]</span></code></div></div><div class="odoc-spec"><div class="spec type" id="type-part_header" class="anchored"><a href="#type-part_header" class="anchor"></a><code><span><span class="keyword">and</span> part_header</span></code></div><div class="spec-doc"><p>Represents a parsed multipart part header data.</p></div></div><h3 id="multipart-reader"><a href="#multipart-reader" class="anchor"></a>Multipart Reader</h3><div class="odoc-spec"><div class="spec value" id="val-reader" class="anchored"><a href="#val-reader" class="anchor"></a><code><span><span class="keyword">val</span> reader : <span>?read_body_len:int <span class="arrow">&#45;&gt;</span></span> <span><a href="../index.html#type-boundary">boundary</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-input">input</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-reader">reader</a></span></code></div><div class="spec-doc"><p><code>reader ?read_body_len boundary input</code> creates reader. The default value for <code>read_body_len</code> is 1KB.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-read_part" class="anchored"><a href="#val-read_part" class="anchor"></a><code><span><span class="keyword">val</span> read_part : <span><a href="#type-reader">reader</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-read_result">read_result</a> <a href="#type-promise">promise</a></span></span></code></div><div class="spec-doc"><p><code>read_part ?read_body_len ~boundary reader</code> reads a http multipart body and returns a <code>read_result</code>.</p></div></div><h3 id="part-header"><a href="#part-header" class="anchor"></a>Part header</h3><div class="odoc-spec"><div class="spec value" id="val-name" class="anchored"><a href="#val-name" class="anchor"></a><code><span><span class="keyword">val</span> name : <span><a href="#type-part_header">part_header</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p><code>name t</code> returns the form field name</p></div></div><div class="odoc-spec"><div class="spec value" id="val-content_type" class="anchored"><a href="#val-content_type" class="anchor"></a><code><span><span class="keyword">val</span> content_type : <span><a href="#type-part_header">part_header</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p><code>content_type t</code> returns the part content-type.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-filename" class="anchored"><a href="#val-filename" class="anchor"></a><code><span><span class="keyword">val</span> filename : <span><a href="#type-part_header">part_header</a> <span class="arrow">&#45;&gt;</span></span> <span>string option</span></span></code></div><div class="spec-doc"><p><code>filename t</code> returns the uploaded filename is the multipart is a file</p></div></div><div class="odoc-spec"><div class="spec value" id="val-header_value" class="anchored"><a href="#val-header_value" class="anchor"></a><code><span><span class="keyword">val</span> header_value : <span>string <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-part_header">part_header</a> <span class="arrow">&#45;&gt;</span></span> <span>string option</span></span></code></div><div class="spec-doc"><p><code>param_value name t</code> returns the multipart parameter value with name <code>name</code>.</p></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_part_header" class="anchored"><a href="#val-pp_part_header" class="anchor"></a><code><span><span class="keyword">val</span> pp_part_header : <span><span class="xref-unresolved">Stdlib</span>.Format.formatter <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-part_header">part_header</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-pp_read_result" class="anchored"><a href="#val-pp_read_result" class="anchor"></a><code><span><span class="keyword">val</span> pp_read_result : <span><span class="xref-unresolved">Stdlib</span>.Format.formatter <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-read_result">read_result</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div></div></body></html>