diff --git a/CHANGES.md b/CHANGES.md index 892b431..3c180cc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/docs/http-multipart-formdata/Http_multipart_formdata/Part/index.html b/docs/http-multipart-formdata/Http_multipart_formdata/Part/index.html index c07fdad..9ed57b5 100644 --- a/docs/http-multipart-formdata/Http_multipart_formdata/Part/index.html +++ b/docs/http-multipart-formdata/Http_multipart_formdata/Part/index.html @@ -1,2 +1,2 @@ -Part (http-multipart-formdata.Http_multipart_formdata.Part)

Module Http_multipart_formdata.Part

Represents a parsed multipart part. A part corresponds to a submitted form field data in a HTTP request.

type t = {
body : bytes;

Body content

name : string;

Name of the part - form field name

content_type : string;

HTTP content type of the part body. "text/plain" is default

filename : string option;

filename form field attribute.

parameters : string Map.t;

Additional key = value params of the form field.

}
val pp : Stdlib.Format.formatter -> t -> unit

pp fmt part is the pretty printer for t.

val equal : t -> t -> bool

equal part1 part2 returns true if part1 and part2 are equal.

\ No newline at end of file +Part (http-multipart-formdata.Http_multipart_formdata.Part)

Module Http_multipart_formdata.Part

Represents a parsed multipart part. A part corresponds to a submitted form field data in a HTTP request.

type t = {
body : bytes;(*

Body content

*)
name : string;(*

Name of the part - form field name

*)
content_type : string;(*

HTTP content type of the part body. "text/plain" is default

*)
filename : string option;(*

filename form field attribute.

*)
parameters : string Map.t;(*

Additional key = value params of the form field.

*)
}
val pp : Stdlib.Format.formatter -> t -> unit

pp fmt part is the pretty printer for t.

val equal : t -> t -> bool

equal part1 part2 returns true if part1 and part2 are equal.

\ No newline at end of file diff --git a/docs/http-multipart-formdata/Http_multipart_formdata/index.html b/docs/http-multipart-formdata/Http_multipart_formdata/index.html index 6a29792..0f42f45 100644 --- a/docs/http-multipart-formdata/Http_multipart_formdata/index.html +++ b/docs/http-multipart-formdata/Http_multipart_formdata/index.html @@ -1,5 +1,5 @@ -Http_multipart_formdata (http-multipart-formdata.Http_multipart_formdata)

Module Http_multipart_formdata

Types

module Map : Stdlib.Map.S with type Map.key = string

An ocaml Stdlib Map with string as key.

module Part : sig ... end

Represents a parsed multipart part. A part corresponds to a submitted form field data in a HTTP request.

type t = Part.t list Map.t

Represents a parsed HTTP multipart/form-data request as a key/value map. Submitted form field name is the key value.

A key may be associated in zero or more values.

exception Multipart of string

Represents error while parsing http multipart formdata.

Parse

val parse : content_type_header:string -> body:string -> t

parse ~content_type_header ~body returns a parsed HTTP multiparts such that it can be queried using ocaml Stdlib.Map functions.

content_type_header is the HTTP request Content-Type header. Note the value contains both the header name and value. It is used to parse a boundary value.

body is the raw HTTP POST request body content.

Examples
module M = Http_multipart_formdata
+Http_multipart_formdata (http-multipart-formdata.Http_multipart_formdata)

Module Http_multipart_formdata

Types

module Map : Stdlib.Map.S with type key = string

An ocaml Stdlib Map with string as key.

module Part : sig ... end

Represents a parsed multipart part. A part corresponds to a submitted form field data in a HTTP request.

type t = Part.t list Map.t

Represents a parsed HTTP multipart/form-data request as a key/value map. Submitted form field name is the key value.

A key may be associated in zero or more values.

exception Multipart of string

Represents error while parsing http multipart formdata.

Parse

val parse : content_type_header:string -> body:string -> t

parse ~content_type_header ~body returns a parsed HTTP multiparts such that it can be queried using ocaml Stdlib.Map functions.

content_type_header is the HTTP request Content-Type header. Note the value contains both the header name and value. It is used to parse a boundary value.

body is the raw HTTP POST request body content.

Examples

module M = Http_multipart_formdata
 
 ;;
 let content_type_header =
@@ -48,4 +48,4 @@
     }
   ]
 in
-M.equal_parts file1_1 file1_2
raises Multipart

Pretty Printers

val pp_parts : Stdlib.Format.formatter -> Part.t list -> unit

pp_parts fmt parts pretty prints a list of Part.t

val pp : Stdlib.Format.formatter -> t -> unit

pp fmt part pretty prints a part.

Equals

val equal_parts : Part.t list -> Part.t list -> bool

equal_parts parts1 parts2 returns true if parts1 and parts2 are equal, false otherwise.

val equal : t -> t -> bool

equal t1 t2 returns true if Part. t1 and t2 are equal, false otherwise.

\ No newline at end of file +M.equal_parts file1_1 file1_2

Pretty Printers

val pp_parts : Stdlib.Format.formatter -> Part.t list -> unit

pp_parts fmt parts pretty prints a list of Part.t

val pp : Stdlib.Format.formatter -> t -> unit

pp fmt part pretty prints a part.

Equals

val equal_parts : Part.t list -> Part.t list -> bool

equal_parts parts1 parts2 returns true if parts1 and parts2 are equal, false otherwise.

val equal : t -> t -> bool

equal t1 t2 returns true if Part. t1 and t2 are equal, false otherwise.

\ No newline at end of file diff --git a/docs/http-multipart-formdata/index.html b/docs/http-multipart-formdata/index.html index 1095476..61ba022 100644 --- a/docs/http-multipart-formdata/index.html +++ b/docs/http-multipart-formdata/index.html @@ -1,2 +1,2 @@ -index (http-multipart-formdata.index)

Http_multipart_formdata

A library which enables HTTP file uploads in ocaml web applications. HTTP file upload requests are generally encoded as multipart/form-data media content type. The library provides a simple api to parse and process such requests.

The parser implements HTTP multipart/form-data standard as defined in RFC 7578.

Modules

Http_multipart_formdata

\ No newline at end of file +index (http-multipart-formdata.index)

Http_multipart_formdata

A library which enables HTTP file uploads in ocaml web applications. HTTP file upload requests are generally encoded as multipart/form-data media content type. The library provides a simple api to parse and process such requests.

The parser implements HTTP multipart/form-data standard as defined in RFC 7578.

Modules

Http_multipart_formdata

\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 837f3d2..5edcfee 100644 --- a/docs/index.html +++ b/docs/index.html @@ -11,7 +11,7 @@

OCaml package documentation

    -
  1. http-multipart-formdata 1.0.0
  2. +
  3. http-multipart-formdata 1.1.0
diff --git a/docs/odoc.css b/docs/odoc.css index 9391118..6f9a517 100644 --- a/docs/odoc.css +++ b/docs/odoc.css @@ -1,13 +1,108 @@ @charset "UTF-8"; /* Copyright (c) 2016 The odoc contributors. All rights reserved. Distributed under the ISC license, see terms at the end of the file. - odoc 1.5.2 */ + odoc 2.0.0-beta2-97-gcb4f04e2 */ /* Fonts */ @import url('https://fonts.googleapis.com/css?family=Fira+Mono:400,500'); @import url('https://fonts.googleapis.com/css?family=Noticia+Text:400,400i,700'); @import url('https://fonts.googleapis.com/css?family=Fira+Sans:400,400i,500,500i,600,600i,700,700i'); +:root, +.light:root { + --link-color: #2C94BD; + --anchor-hover: #555; + --anchor-color: #d5d5d5; + --xref-shadow: #cc6666; + --header-shadow: #ddd; + --by-name-version-color: #aaa; + --by-name-nav-link-color: #222; + --target-background: rgba(187, 239, 253, 0.3); + --target-shadow: rgba(187, 239, 253, 0.8); + --pre-border-color: #eee; + --code-background: #f6f8fa; + --spec-summary-border-color: #5c9cf5; + --spec-summary-background: var(--code-background); + --spec-summary-hover-background: #ebeff2; + --spec-details-after-background: rgba(0, 4, 15, 0.05); + --spec-details-after-shadow: rgba(204, 204, 204, 0.53); +} + +.dark:root { + --main-background: #202020; + --code-background: #222; + --line-numbers-background: rgba(0, 0, 0, 0.125); + --navbar-background: #202020; + + --color: #bebebe; + --dirname-color: #666; + --underline-color: #444; + --visited-color: #002800; + --visited-number-color: #252; + --unvisited-color: #380000; + --unvisited-number-color: #622; + --somevisited-color: #303000; + --highlight-color: #303e3f; + --line-number-color: rgba(230, 230, 230, 0.3); + --unvisited-margin-color: #622; + --border: #333; + --navbar-border: #333; + --code-color: #ccc; + + --hljs-link: #999; + --hljs-keyword: #cda869; + --hljs-regexp: #f9ee98; + --hljs-title: #dcdcaa; + --hljs-type: #ac885b; + --hljs-meta: #82aaff; + --hljs-variable: #cf6a4c; +} + +@media (prefers-color-scheme: dark) { + :root { + --main-background: #202020; + --code-background: #333; + --line-numbers-background: rgba(0, 0, 0, 0.125); + --navbar-background: #202020; + + --meter-unvisited-color: #622; + --meter-visited-color: #252; + --meter-separator-color: black; + + --color: #bebebe; + --dirname-color: #666; + --underline-color: #444; + --visited-color: #002800; + --visited-number-color: #252; + --unvisited-color: #380000; + --unvisited-number-color: #622; + --somevisited-color: #303000; + --highlight-color: #303e3f; + --line-number-color: rgba(230, 230, 230, 0.3); + --unvisited-margin-color: #622; + --border: #333; + --navbar-border: #333; + --code-color: #ccc; + --by-name-nav-link-color: var(--color); + + --li-code-background: #373737; + --li-code-color: #999; + --toc-color: #777; + --toc-background: #252525; + --toc-list-border: #ccc; + --spec-summary-hover-background: #ebeff2; + --spec-details-after-background: rgba(0, 4, 15, 0.05); + --spec-details-after-shadow: rgba(204, 204, 204, 0.53); + + --hljs-link: #999; + --hljs-keyword: #cda869; + --hljs-regexp: #f9ee98; + --hljs-title: #dcdcaa; + --hljs-type: #ac885b; + --hljs-meta: #82aaff; + --hljs-variable: #cf6a4c; + } +} /* Reset a few things. */ @@ -15,13 +110,9 @@ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockq margin: 0; padding: 0; border: 0; - font-size: inherit; font: inherit; - line-height: inherit; vertical-align: baseline; - text-align: inherit; - color: inherit; - background: transparent; + } table { @@ -38,13 +129,13 @@ html { } body { - font-family: "Fira Sans", Helvetica, Arial, sans-serif; text-align: left; - color: #333; background: #FFFFFF; + color: var(--color); + background-color: var(--main-background); } -.content { +body { max-width: 90ex; margin-left: calc(10vw + 20ex); margin-right: 4ex; @@ -54,24 +145,32 @@ body { line-height: 1.5; } -.content>header { +header { margin-bottom: 30px; } -.content>header nav { +nav { font-family: "Fira Sans", Helvetica, Arial, sans-serif; } /* Basic markup elements */ b, strong { - font-weight: 500; + font-weight: bold; +} + +i { + font-style: italic; } -i, em { +em, i em.odd{ font-style: italic; } +em.odd, i em { + font-style: normal; +} + sup { vertical-align: super; } @@ -130,31 +229,36 @@ li>*:first-child { a { text-decoration: none; color: #2C5CBD; + color: var(--link-color); } a:hover { box-shadow: 0 1px 0 0 #2C5CBD; + box-shadow: 0 1px 0 0 var(--link-color); } /* Linked highlight */ *:target { background-color: rgba(187,239,253,0.3) !important; box-shadow: 0 0px 0 1px rgba(187,239,253,0.8) !important; + background-color: var(--target-background) !important; + box-shadow: 0 0px 0 1px var(--target-shadow) !important; border-radius: 1px; } -*:hover>a.anchor { +*:hover > a.anchor { visibility: visible; } a.anchor:before { - content: "#" + content: "#"; } a.anchor:hover { box-shadow: none; text-decoration: none; color: #555; + color: var(--anchor-hover); } a.anchor { @@ -169,6 +273,7 @@ a.anchor { padding-left: 0.4em; /* To remain selectable */ color: #d5d5d5; + color: var(--anchor-color); } .spec > a.anchor { @@ -177,10 +282,11 @@ a.anchor { } .xref-unresolved { - color: #2C5CBD; + color: #2C94BD; } .xref-unresolved:hover { box-shadow: 0 1px 0 0 #CC6666; + box-shadow: 0 1px 0 0 var(--xref-shadow); } /* Section and document divisions. @@ -206,6 +312,7 @@ h1 { font-weight: 500; font-size: 1.953em; box-shadow: 0 1px 0 0 #ddd; + box-shadow: 0 1px 0 0 var(--header-shadow); } h2 { @@ -244,6 +351,22 @@ h4 { font-size: 1.12em; } +/* Comment delimiters, hidden but accessible to screen readers and + selected for copy/pasting */ + +/* Taken from bootstrap */ +/* See also https://stackoverflow.com/a/27769435/4220738 */ +.comment-delim { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; +} /* Preformatted and code */ @@ -255,19 +378,24 @@ tt, code, pre { pre { padding: 0.1em; border: 1px solid #eee; + border: 1px solid var(--pre-border-color); border-radius: 5px; overflow-x: auto; } -p code, li code { +p code, +li code { background-color: #f6f8fa; color: #0d2b3e; + background-color: var(--li-code-background); + color: var(--li-code-color); border-radius: 3px; padding: 0 0.3ex; } p a > code { color: #2C5CBD; + color: var(--link-color); } /* Code blocks (e.g. Examples) */ @@ -282,44 +410,22 @@ pre code { font-weight: 500; } +.arrow { white-space: nowrap } + /* Module member specification */ -.spec:not(.include), .spec.include details summary { - background-color: #f6f8fa; +.spec { + background-color: var(--spec-summary-background); border-radius: 3px; - border-left: 4px solid #5c9cf5; + border-left: 4px solid var(--spec-summary-border-color); border-right: 5px solid transparent; padding: 0.35em 0.5em; } -.spec.include details summary:hover { - background-color: #ebeff2; -} - -dl, div.spec, .doc, aside { +div.spec, .def-doc { margin-bottom: 20px; } -dl > dd { - padding: 0.5em; -} - -dd> :first-child { - margin-top: 0; -} - -dl:last-child, dd> :last-child, aside:last-child, article:last-child { - margin-bottom: 0; -} - -dt+dt { - margin-top: 15px; -} - -section+section, section > header + dl { - margin-top: 25px; -} - .spec.type .variant { margin-left: 2ch; } @@ -341,27 +447,22 @@ div.def { padding-left: 2ex; } -div.def+div.doc { +div.def+div.def-doc { margin-left: 1ex; margin-top: 2.5px } -div.doc>*:first-child { +div.def-doc>*:first-child { margin-top: 0; } -/* The elements other than heading should be wrapped in