From d407337ccab35ad3aef399d7979e05d38e97c446 Mon Sep 17 00:00:00 2001 From: c-cube Date: Sat, 3 Sep 2022 18:14:06 +0000 Subject: [PATCH] deploy: a3f27bd3cbf03d5e02137ed0bdd9cec91f1e075f --- dev/odoc.css | 2 +- dev/tiny_httpd/Tiny_httpd/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_buf/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_dir/Embedded_fs/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_dir/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_dir/module-type-VFS/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_html/index.html | 4 ++-- dev/tiny_httpd/Tiny_httpd_html_/A/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_html_/Out/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_html_/index.html | 4 ++-- dev/tiny_httpd/Tiny_httpd_server/Headers/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_server/Meth/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_server/Middleware/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_server/Request/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_server/Response/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_server/Response_code/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_server/Route/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_server/index.html | 2 +- .../module-type-SERVER_SENT_GENERATOR/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_stream/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_util/index.html | 2 +- dev/tiny_httpd/index.html | 2 +- dev/tiny_httpd_camlzip/Tiny_httpd_camlzip/index.html | 2 +- dev/tiny_httpd_camlzip/index.html | 2 +- 24 files changed, 26 insertions(+), 26 deletions(-) diff --git a/dev/odoc.css b/dev/odoc.css index 5362774e..edc8a2b3 100644 --- a/dev/odoc.css +++ b/dev/odoc.css @@ -1,7 +1,7 @@ @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 2.1.0 */ + odoc 2.1.1 */ /* Fonts */ @import url('https://fonts.googleapis.com/css?family=Fira+Mono:400,500'); diff --git a/dev/tiny_httpd/Tiny_httpd/index.html b/dev/tiny_httpd/Tiny_httpd/index.html index 80066f22..2a0d3824 100644 --- a/dev/tiny_httpd/Tiny_httpd/index.html +++ b/dev/tiny_httpd/Tiny_httpd/index.html @@ -1,5 +1,5 @@ -Tiny_httpd (tiny_httpd.Tiny_httpd)

Module Tiny_httpd

Tiny Http Server

This library implements a very simple, basic HTTP/1.1 server using blocking IOs and threads. Basic routing based on Scanf is provided for convenience, so that several handlers can be registered.

It is possible to use a thread pool, see create's argument new_thread.

The echo example (see src/examples/echo.ml) demonstrates some of the features by declaring a few endpoints, including one for uploading files:

module S = Tiny_httpd
+Tiny_httpd (tiny_httpd.Tiny_httpd)

Module Tiny_httpd

Tiny Http Server

This library implements a very simple, basic HTTP/1.1 server using blocking IOs and threads. Basic routing based on Scanf is provided for convenience, so that several handlers can be registered.

It is possible to use a thread pool, see create's argument new_thread.

The echo example (see src/examples/echo.ml) demonstrates some of the features by declaring a few endpoints, including one for uploading files:

module S = Tiny_httpd
 
 let () =
   let server = S.create () in
diff --git a/dev/tiny_httpd/Tiny_httpd_buf/index.html b/dev/tiny_httpd/Tiny_httpd_buf/index.html
index d42bfe3e..27e4d643 100644
--- a/dev/tiny_httpd/Tiny_httpd_buf/index.html
+++ b/dev/tiny_httpd/Tiny_httpd_buf/index.html
@@ -1,2 +1,2 @@
 
-Tiny_httpd_buf (tiny_httpd.Tiny_httpd_buf)

Module Tiny_httpd_buf

Simple buffer.

These buffers are used to avoid allocating too many byte arrays when processing streams and parsing requests.

  • since 0.12
type t
val size : t -> int
val clear : t -> unit
val create : ?size:int -> unit -> t
val contents : t -> string
val bytes_slice : t -> bytes

Access underlying slice of bytes.

  • since 0.5
val contents_and_clear : t -> string

Get contents of the buffer and clear it.

  • since 0.5
val add_bytes : t -> bytes -> int -> int -> unit

Append given bytes slice to the buffer.

  • since 0.5
\ No newline at end of file +Tiny_httpd_buf (tiny_httpd.Tiny_httpd_buf)

Module Tiny_httpd_buf

Simple buffer.

These buffers are used to avoid allocating too many byte arrays when processing streams and parsing requests.

  • since 0.12
type t
val size : t -> int
val clear : t -> unit
val create : ?size:int -> unit -> t
val contents : t -> string
val bytes_slice : t -> bytes

Access underlying slice of bytes.

  • since 0.5
val contents_and_clear : t -> string

Get contents of the buffer and clear it.

  • since 0.5
val add_bytes : t -> bytes -> int -> int -> unit

Append given bytes slice to the buffer.

  • since 0.5
\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_dir/Embedded_fs/index.html b/dev/tiny_httpd/Tiny_httpd_dir/Embedded_fs/index.html index d36ea1d7..4b417315 100644 --- a/dev/tiny_httpd/Tiny_httpd_dir/Embedded_fs/index.html +++ b/dev/tiny_httpd/Tiny_httpd_dir/Embedded_fs/index.html @@ -1,2 +1,2 @@ -Embedded_fs (tiny_httpd.Tiny_httpd_dir.Embedded_fs)

Module Tiny_httpd_dir.Embedded_fs

An embedded file system, as a list of files with (relative) paths. This is useful in combination with the "tiny-httpd-mkfs" tool, which embeds the files it's given into a OCaml module.

  • since 0.12
type t

The pseudo-filesystem

val create : ?mtime:float -> unit -> t
val add_file : ?mtime:float -> t -> path:string -> string -> unit

Add file to the virtual file system.

  • raises Invalid_argument

    if the path contains '..' or if it tries to make a directory out of an existing path that is a file.

val to_vfs : t -> (module VFS)
\ No newline at end of file +Embedded_fs (tiny_httpd.Tiny_httpd_dir.Embedded_fs)

Module Tiny_httpd_dir.Embedded_fs

An embedded file system, as a list of files with (relative) paths. This is useful in combination with the "tiny-httpd-mkfs" tool, which embeds the files it's given into a OCaml module.

  • since 0.12
type t

The pseudo-filesystem

val create : ?mtime:float -> unit -> t
val add_file : ?mtime:float -> t -> path:string -> string -> unit

Add file to the virtual file system.

  • raises Invalid_argument

    if the path contains '..' or if it tries to make a directory out of an existing path that is a file.

val to_vfs : t -> (module VFS)
\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_dir/index.html b/dev/tiny_httpd/Tiny_httpd_dir/index.html index 66211451..64be6c8a 100644 --- a/dev/tiny_httpd/Tiny_httpd_dir/index.html +++ b/dev/tiny_httpd/Tiny_httpd_dir/index.html @@ -1,5 +1,5 @@ -Tiny_httpd_dir (tiny_httpd.Tiny_httpd_dir)

Module Tiny_httpd_dir

Serving static content from directories

This module provides the same functionality as the "http_of_dir" tool. It exposes a directory (and its subdirectories), with the optional ability to delete or upload files.

  • since 0.11
type dir_behavior =
| Index(*

Redirect to index.html if present, else fails.

*)
| Lists(*

Lists content of directory. Be careful of security implications.

*)
| Index_or_lists(*

Redirect to index.html if present and lists content otherwise. This is useful for tilde ("~") directories and other per-user behavior, but be mindful of security implications

*)
| Forbidden(*

Forbid access to directory. This is suited for serving assets, for example.

*)

behavior of static directory.

This controls what happens when the user requests the path to a directory rather than a file.

type hidden

Type used to prevent users from building a config directly. Use default_config or config instead.

type config = {
mutable download : bool;(*

Is downloading files allowed?

*)
mutable dir_behavior : dir_behavior;(*

Behavior when serving a directory and not a file

*)
mutable delete : bool;(*

Is deleting a file allowed? (with method DELETE)

*)
mutable upload : bool;(*

Is uploading a file allowed? (with method PUT)

*)
mutable max_upload_size : int;(*

If upload is true, this is the maximum size in bytes for uploaded files.

*)
_rest : hidden;(*

Just ignore this field.

*)
}

configuration for static file handlers. This might get more fields over time.

val default_config : unit -> config

default configuration: +Tiny_httpd_dir (tiny_httpd.Tiny_httpd_dir)

Module Tiny_httpd_dir

Serving static content from directories

This module provides the same functionality as the "http_of_dir" tool. It exposes a directory (and its subdirectories), with the optional ability to delete or upload files.

  • since 0.11
type dir_behavior =
| Index(*

Redirect to index.html if present, else fails.

*)
| Lists(*

Lists content of directory. Be careful of security implications.

*)
| Index_or_lists(*

Redirect to index.html if present and lists content otherwise. This is useful for tilde ("~") directories and other per-user behavior, but be mindful of security implications

*)
| Forbidden(*

Forbid access to directory. This is suited for serving assets, for example.

*)

behavior of static directory.

This controls what happens when the user requests the path to a directory rather than a file.

type hidden

Type used to prevent users from building a config directly. Use default_config or config instead.

type config = {
mutable download : bool;(*

Is downloading files allowed?

*)
mutable dir_behavior : dir_behavior;(*

Behavior when serving a directory and not a file

*)
mutable delete : bool;(*

Is deleting a file allowed? (with method DELETE)

*)
mutable upload : bool;(*

Is uploading a file allowed? (with method PUT)

*)
mutable max_upload_size : int;(*

If upload is true, this is the maximum size in bytes for uploaded files.

*)
_rest : hidden;(*

Just ignore this field.

*)
}

configuration for static file handlers. This might get more fields over time.

val default_config : unit -> config

default configuration: { download=true ; dir_behavior=Forbidden ; delete=false diff --git a/dev/tiny_httpd/Tiny_httpd_dir/module-type-VFS/index.html b/dev/tiny_httpd/Tiny_httpd_dir/module-type-VFS/index.html index 2c6c3b8d..12bda615 100644 --- a/dev/tiny_httpd/Tiny_httpd_dir/module-type-VFS/index.html +++ b/dev/tiny_httpd/Tiny_httpd_dir/module-type-VFS/index.html @@ -1,2 +1,2 @@ -VFS (tiny_httpd.Tiny_httpd_dir.VFS)

Module type Tiny_httpd_dir.VFS

Virtual file system.

This is used to emulate a file system from pure OCaml functions and data, e.g. for resources bundled inside the web server.

  • since 0.12
val descr : string

Description of the VFS

val is_directory : string -> bool
val contains : string -> bool

file_exists vfs path returns true if path points to a file or directory inside vfs.

val list_dir : string -> string array

List directory. This only returns basenames, the files need to be put in the directory path using Filename.concat.

val delete : string -> unit

Delete path

val create : string -> ( bytes -> int -> int -> unit ) * ( unit -> unit )

Create a file and obtain a pair write, close

val read_file_content : string -> Tiny_httpd_stream.t

Read content of a file

val file_size : string -> int option

File size, e.g. using "stat"

val file_mtime : string -> float option

File modification time, e.g. using "stat"

\ No newline at end of file +VFS (tiny_httpd.Tiny_httpd_dir.VFS)

Module type Tiny_httpd_dir.VFS

Virtual file system.

This is used to emulate a file system from pure OCaml functions and data, e.g. for resources bundled inside the web server.

  • since 0.12
val descr : string

Description of the VFS

val is_directory : string -> bool
val contains : string -> bool

file_exists vfs path returns true if path points to a file or directory inside vfs.

val list_dir : string -> string array

List directory. This only returns basenames, the files need to be put in the directory path using Filename.concat.

val delete : string -> unit

Delete path

val create : string -> ( bytes -> int -> int -> unit ) * ( unit -> unit )

Create a file and obtain a pair write, close

val read_file_content : string -> Tiny_httpd_stream.t

Read content of a file

val file_size : string -> int option

File size, e.g. using "stat"

val file_mtime : string -> float option

File modification time, e.g. using "stat"

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_html/index.html b/dev/tiny_httpd/Tiny_httpd_html/index.html index 258b68b8..af381c50 100644 --- a/dev/tiny_httpd/Tiny_httpd_html/index.html +++ b/dev/tiny_httpd/Tiny_httpd_html/index.html @@ -1,4 +1,4 @@ -Tiny_httpd_html (tiny_httpd.Tiny_httpd_html)

Module Tiny_httpd_html

HTML combinators.

This module provides combinators to produce html. It doesn't enforce the well-formedness of the html, unlike Tyxml, but it's simple and should be reasonably efficient.

  • since 0.12

Output for HTML combinators.

type attribute = string * string

An attribute, i.e. a key/value pair

type elt = Out.t -> unit

A html element. It is represented by its output function, so we can directly print it.

type void = ?if_:bool -> attribute list -> elt

Element without children.

type nary = ?if_:bool -> attribute list -> elt list -> elt

Element with children, represented as a list.

  • parameter if_

    if false, do not print anything (default true)

type sub_elt = [
| `E of elt
| `L of elt list
| `S of elt Stdlib.Seq.t
| `Nil
]

A chunk of sub-elements, possibly empty.

type nary' = ?if_:bool -> attribute list -> sub_elt list -> elt

Element with children, represented as a list of sub_elt to be flattened

  • parameter if_

    if false, do not print anything (default true)

val sub_e : elt -> sub_elt

Sub-element with a single element inside.

val sub_l : elt list -> sub_elt

Sub-element with a list of items inside.

val sub_seq : elt Stdlib.Seq.t -> sub_elt

Sub-element with a sequence (Seq.t) of items inside.

val seq_of_array : 'a array -> 'a Stdlib.Seq.t

Helper to build a Seq.t from an array.

val sub_empty : sub_elt

Sub-element with nothing inside. Useful in conditionals, when one decides not to emit a sub-element at all.

val txt : string -> elt

Emit a string value, which will be escaped.

val txtf : +Tiny_httpd_html (tiny_httpd.Tiny_httpd_html)

Module Tiny_httpd_html

HTML combinators.

This module provides combinators to produce html. It doesn't enforce the well-formedness of the html, unlike Tyxml, but it's simple and should be reasonably efficient.

  • since 0.12

Output for HTML combinators.

type attribute = string * string

An attribute, i.e. a key/value pair

type elt = Out.t -> unit

A html element. It is represented by its output function, so we can directly print it.

type void = ?if_:bool -> attribute list -> elt

Element without children.

type nary = ?if_:bool -> attribute list -> elt list -> elt

Element with children, represented as a list.

  • parameter if_

    if false, do not print anything (default true)

type sub_elt = [
| `E of elt
| `L of elt list
| `S of elt Stdlib.Seq.t
| `Nil
]

A chunk of sub-elements, possibly empty.

type nary' = ?if_:bool -> attribute list -> sub_elt list -> elt

Element with children, represented as a list of sub_elt to be flattened

  • parameter if_

    if false, do not print anything (default true)

val sub_e : elt -> sub_elt

Sub-element with a single element inside.

val sub_l : elt list -> sub_elt

Sub-element with a list of items inside.

val sub_seq : elt Stdlib.Seq.t -> sub_elt

Sub-element with a sequence (Seq.t) of items inside.

val seq_of_array : 'a array -> 'b Stdlib.Seq.t

Helper to build a Seq.t from an array.

val sub_empty : sub_elt

Sub-element with nothing inside. Useful in conditionals, when one decides not to emit a sub-element at all.

val txt : string -> elt

Emit a string value, which will be escaped.

val txtf : ( 'a, Stdlib.Format.formatter, unit, Out.t -> unit ) Stdlib.format4 -> - 'a

Formatted version of txt

val raw_html : string -> elt

Emit raw HTML. Caution, this can lead to injection vulnerabilities, never use with text that comes from untrusted users.

val area : void

tag "area", see mdn

val base : void

tag "base", see mdn

val br : void

tag "br", see mdn

val col : void

tag "col", see mdn

val embed : void

tag "embed", see mdn

val hr : void

tag "hr", see mdn

val img : void

tag "img", see mdn

val input : void

tag "input", see mdn

tag "link", see mdn

val menuitem : void

tag "menuitem", see mdn

val meta : void

tag "meta", see mdn

val param : void

tag "param", see mdn

val source : void

tag "source", see mdn

val track : void

tag "track", see mdn

val wbr : void

tag "wbr", see mdn

val a : nary

tag "a", see mdn

val a' : nary'

tag "a", see mdn

val abbr : nary

tag "abbr", see mdn

val abbr' : nary'

tag "abbr", see mdn

val address : nary

tag "address", see mdn

val address' : nary'

tag "address", see mdn

val article : nary

tag "article", see mdn

val article' : nary'

tag "article", see mdn

val aside : nary

tag "aside", see mdn

val aside' : nary'

tag "aside", see mdn

val audio : nary

tag "audio", see mdn

val audio' : nary'

tag "audio", see mdn

val b : nary

tag "b", see mdn

val b' : nary'

tag "b", see mdn

val bdi : nary

tag "bdi", see mdn

val bdi' : nary'

tag "bdi", see mdn

val bdo : nary

tag "bdo", see mdn

val bdo' : nary'

tag "bdo", see mdn

val blockquote : nary

tag "blockquote", see mdn

val blockquote' : nary'

tag "blockquote", see mdn

val body : nary

tag "body", see mdn

val body' : nary'

tag "body", see mdn

val button : nary

tag "button", see mdn

val button' : nary'

tag "button", see mdn

val canvas : nary

tag "canvas", see mdn

val canvas' : nary'

tag "canvas", see mdn

val caption : nary

tag "caption", see mdn

val caption' : nary'

tag "caption", see mdn

val cite : nary

tag "cite", see mdn

val cite' : nary'

tag "cite", see mdn

val code : nary

tag "code", see mdn

val code' : nary'

tag "code", see mdn

val colgroup : nary

tag "colgroup", see mdn

val colgroup' : nary'

tag "colgroup", see mdn

val data : nary

tag "data", see mdn

val data' : nary'

tag "data", see mdn

val datalist : nary

tag "datalist", see mdn

val datalist' : nary'

tag "datalist", see mdn

val dd : nary

tag "dd", see mdn

val dd' : nary'

tag "dd", see mdn

val del : nary

tag "del", see mdn

val del' : nary'

tag "del", see mdn

val details : nary

tag "details", see mdn

val details' : nary'

tag "details", see mdn

val dfn : nary

tag "dfn", see mdn

val dfn' : nary'

tag "dfn", see mdn

val dialog : nary

tag "dialog", see mdn

val dialog' : nary'

tag "dialog", see mdn

val div : nary

tag "div", see mdn

val div' : nary'

tag "div", see mdn

val dl : nary

tag "dl", see mdn

val dl' : nary'

tag "dl", see mdn

val dt : nary

tag "dt", see mdn

val dt' : nary'

tag "dt", see mdn

val em : nary

tag "em", see mdn

val em' : nary'

tag "em", see mdn

val fieldset : nary

tag "fieldset", see mdn

val fieldset' : nary'

tag "fieldset", see mdn

val figcaption : nary

tag "figcaption", see mdn

val figcaption' : nary'

tag "figcaption", see mdn

val figure : nary

tag "figure", see mdn

val figure' : nary'

tag "figure", see mdn

tag "footer", see mdn

val footer' : nary'

tag "footer", see mdn

val form : nary

tag "form", see mdn

val form' : nary'

tag "form", see mdn

val h1 : nary

tag "h1", see mdn

val h1' : nary'

tag "h1", see mdn

val h2 : nary

tag "h2", see mdn

val h2' : nary'

tag "h2", see mdn

val h3 : nary

tag "h3", see mdn

val h3' : nary'

tag "h3", see mdn

val h4 : nary

tag "h4", see mdn

val h4' : nary'

tag "h4", see mdn

val h5 : nary

tag "h5", see mdn

val h5' : nary'

tag "h5", see mdn

val h6 : nary

tag "h6", see mdn

val h6' : nary'

tag "h6", see mdn

val head : nary

tag "head", see mdn

val head' : nary'

tag "head", see mdn

val header : nary

tag "header", see mdn

val header' : nary'

tag "header", see mdn

val hgroup : nary

tag "hgroup", see mdn

val hgroup' : nary'

tag "hgroup", see mdn

val html : nary

tag "html", see mdn

val html' : nary'

tag "html", see mdn

val i : nary

tag "i", see mdn

val i' : nary'

tag "i", see mdn

val iframe : nary

tag "iframe", see mdn

val iframe' : nary'

tag "iframe", see mdn

val ins : nary

tag "ins", see mdn

val ins' : nary'

tag "ins", see mdn

val kbd : nary

tag "kbd", see mdn

val kbd' : nary'

tag "kbd", see mdn

val label : nary

tag "label", see mdn

val label' : nary'

tag "label", see mdn

val legend : nary

tag "legend", see mdn

val legend' : nary'

tag "legend", see mdn

val li : nary

tag "li", see mdn

val li' : nary'

tag "li", see mdn

val main : nary

tag "main", see mdn

val main' : nary'

tag "main", see mdn

val map : nary

tag "map", see mdn

val map' : nary'

tag "map", see mdn

val mark : nary

tag "mark", see mdn

val mark' : nary'

tag "mark", see mdn

val math : nary

tag "math", see mdn

val math' : nary'

tag "math", see mdn

val menu : nary

tag "menu", see mdn

val menu' : nary'

tag "menu", see mdn

val meter : nary

tag "meter", see mdn

val meter' : nary'

tag "meter", see mdn

val nav : nary

tag "nav", see mdn

val nav' : nary'

tag "nav", see mdn

val noscript : nary

tag "noscript", see mdn

val noscript' : nary'

tag "noscript", see mdn

val object_ : nary

tag "object", see mdn

val object_' : nary'

tag "object", see mdn

val ol : nary

tag "ol", see mdn

val ol' : nary'

tag "ol", see mdn

val optgroup : nary

tag "optgroup", see mdn

val optgroup' : nary'

tag "optgroup", see mdn

val option : nary

tag "option", see mdn

val option' : nary'

tag "option", see mdn

val output : nary

tag "output", see mdn

val output' : nary'

tag "output", see mdn

val p : nary

tag "p", see mdn

val p' : nary'

tag "p", see mdn

val picture : nary

tag "picture", see mdn

val picture' : nary'

tag "picture", see mdn

val pre : nary

tag "pre", see mdn

val pre' : nary'

tag "pre", see mdn

val progress : nary

tag "progress", see mdn

val progress' : nary'

tag "progress", see mdn

val q : nary

tag "q", see mdn

val q' : nary'

tag "q", see mdn

val rb : nary

tag "rb", see mdn

val rb' : nary'

tag "rb", see mdn

val rp : nary

tag "rp", see mdn

val rp' : nary'

tag "rp", see mdn

val rt : nary

tag "rt", see mdn

val rt' : nary'

tag "rt", see mdn

val rtc : nary

tag "rtc", see mdn

val rtc' : nary'

tag "rtc", see mdn

val ruby : nary

tag "ruby", see mdn

val ruby' : nary'

tag "ruby", see mdn

val s : nary

tag "s", see mdn

val s' : nary'

tag "s", see mdn

val samp : nary

tag "samp", see mdn

val samp' : nary'

tag "samp", see mdn

val script : nary

tag "script", see mdn

val script' : nary'

tag "script", see mdn

val section : nary

tag "section", see mdn

val section' : nary'

tag "section", see mdn

val select : nary

tag "select", see mdn

val select' : nary'

tag "select", see mdn

val slot : nary

tag "slot", see mdn

val slot' : nary'

tag "slot", see mdn

val small : nary

tag "small", see mdn

val small' : nary'

tag "small", see mdn

val span : nary

tag "span", see mdn

val span' : nary'

tag "span", see mdn

val strong : nary

tag "strong", see mdn

val strong' : nary'

tag "strong", see mdn

val style : nary

tag "style", see mdn

val style' : nary'

tag "style", see mdn

val sub : nary

tag "sub", see mdn

val sub' : nary'

tag "sub", see mdn

val summary : nary

tag "summary", see mdn

val summary' : nary'

tag "summary", see mdn

val sup : nary

tag "sup", see mdn

val sup' : nary'

tag "sup", see mdn

val svg : nary

tag "svg", see mdn

val svg' : nary'

tag "svg", see mdn

val table : nary

tag "table", see mdn

val table' : nary'

tag "table", see mdn

val tbody : nary

tag "tbody", see mdn

val tbody' : nary'

tag "tbody", see mdn

val td : nary

tag "td", see mdn

val td' : nary'

tag "td", see mdn

val template : nary

tag "template", see mdn

val template' : nary'

tag "template", see mdn

val textarea : nary

tag "textarea", see mdn

val textarea' : nary'

tag "textarea", see mdn

val tfoot : nary

tag "tfoot", see mdn

val tfoot' : nary'

tag "tfoot", see mdn

val th : nary

tag "th", see mdn

val th' : nary'

tag "th", see mdn

val thead : nary

tag "thead", see mdn

val thead' : nary'

tag "thead", see mdn

val time : nary

tag "time", see mdn

val time' : nary'

tag "time", see mdn

val title : nary

tag "title", see mdn

val title' : nary'

tag "title", see mdn

val tr : nary

tag "tr", see mdn

val tr' : nary'

tag "tr", see mdn

val u : nary

tag "u", see mdn

val u' : nary'

tag "u", see mdn

val ul : nary

tag "ul", see mdn

val ul' : nary'

tag "ul", see mdn

val var : nary

tag "var", see mdn

val var' : nary'

tag "var", see mdn

val video : nary

tag "video", see mdn

val video' : nary'

tag "video", see mdn

Attributes.

val to_string : ?top:bool -> elt -> string

Convert a HTML element to a string.

  • parameter top

    if true, add DOCTYPE at the beginning. The top element should then be a "html" tag.

val to_string_l : elt list -> string

Convert a list of HTML elements to a string. This is designed for fragments of HTML that are to be injected inside a bigger context, as it's invalid to have multiple elements at the toplevel of a HTML document.

val to_string_top : elt -> string
val to_stream : elt -> Tiny_httpd_stream.t

Convert a HTML element to a stream. This might just convert it to a string first, do not assume it to be more efficient.

\ No newline at end of file + 'b

Formatted version of txt

val raw_html : string -> elt

Emit raw HTML. Caution, this can lead to injection vulnerabilities, never use with text that comes from untrusted users.

val area : void

tag "area", see mdn

val base : void

tag "base", see mdn

val br : void

tag "br", see mdn

val col : void

tag "col", see mdn

val embed : void

tag "embed", see mdn

val hr : void

tag "hr", see mdn

val img : void

tag "img", see mdn

val input : void

tag "input", see mdn

tag "link", see mdn

val menuitem : void

tag "menuitem", see mdn

val meta : void

tag "meta", see mdn

val param : void

tag "param", see mdn

val source : void

tag "source", see mdn

val track : void

tag "track", see mdn

val wbr : void

tag "wbr", see mdn

val a : nary

tag "a", see mdn

val a' : nary'

tag "a", see mdn

val abbr : nary

tag "abbr", see mdn

val abbr' : nary'

tag "abbr", see mdn

val address : nary

tag "address", see mdn

val address' : nary'

tag "address", see mdn

val article : nary

tag "article", see mdn

val article' : nary'

tag "article", see mdn

val aside : nary

tag "aside", see mdn

val aside' : nary'

tag "aside", see mdn

val audio : nary

tag "audio", see mdn

val audio' : nary'

tag "audio", see mdn

val b : nary

tag "b", see mdn

val b' : nary'

tag "b", see mdn

val bdi : nary

tag "bdi", see mdn

val bdi' : nary'

tag "bdi", see mdn

val bdo : nary

tag "bdo", see mdn

val bdo' : nary'

tag "bdo", see mdn

val blockquote : nary

tag "blockquote", see mdn

val blockquote' : nary'

tag "blockquote", see mdn

val body : nary

tag "body", see mdn

val body' : nary'

tag "body", see mdn

val button : nary

tag "button", see mdn

val button' : nary'

tag "button", see mdn

val canvas : nary

tag "canvas", see mdn

val canvas' : nary'

tag "canvas", see mdn

val caption : nary

tag "caption", see mdn

val caption' : nary'

tag "caption", see mdn

val cite : nary

tag "cite", see mdn

val cite' : nary'

tag "cite", see mdn

val code : nary

tag "code", see mdn

val code' : nary'

tag "code", see mdn

val colgroup : nary

tag "colgroup", see mdn

val colgroup' : nary'

tag "colgroup", see mdn

val data : nary

tag "data", see mdn

val data' : nary'

tag "data", see mdn

val datalist : nary

tag "datalist", see mdn

val datalist' : nary'

tag "datalist", see mdn

val dd : nary

tag "dd", see mdn

val dd' : nary'

tag "dd", see mdn

val del : nary

tag "del", see mdn

val del' : nary'

tag "del", see mdn

val details : nary

tag "details", see mdn

val details' : nary'

tag "details", see mdn

val dfn : nary

tag "dfn", see mdn

val dfn' : nary'

tag "dfn", see mdn

val dialog : nary

tag "dialog", see mdn

val dialog' : nary'

tag "dialog", see mdn

val div : nary

tag "div", see mdn

val div' : nary'

tag "div", see mdn

val dl : nary

tag "dl", see mdn

val dl' : nary'

tag "dl", see mdn

val dt : nary

tag "dt", see mdn

val dt' : nary'

tag "dt", see mdn

val em : nary

tag "em", see mdn

val em' : nary'

tag "em", see mdn

val fieldset : nary

tag "fieldset", see mdn

val fieldset' : nary'

tag "fieldset", see mdn

val figcaption : nary

tag "figcaption", see mdn

val figcaption' : nary'

tag "figcaption", see mdn

val figure : nary

tag "figure", see mdn

val figure' : nary'

tag "figure", see mdn

tag "footer", see mdn

val footer' : nary'

tag "footer", see mdn

val form : nary

tag "form", see mdn

val form' : nary'

tag "form", see mdn

val h1 : nary

tag "h1", see mdn

val h1' : nary'

tag "h1", see mdn

val h2 : nary

tag "h2", see mdn

val h2' : nary'

tag "h2", see mdn

val h3 : nary

tag "h3", see mdn

val h3' : nary'

tag "h3", see mdn

val h4 : nary

tag "h4", see mdn

val h4' : nary'

tag "h4", see mdn

val h5 : nary

tag "h5", see mdn

val h5' : nary'

tag "h5", see mdn

val h6 : nary

tag "h6", see mdn

val h6' : nary'

tag "h6", see mdn

val head : nary

tag "head", see mdn

val head' : nary'

tag "head", see mdn

val header : nary

tag "header", see mdn

val header' : nary'

tag "header", see mdn

val hgroup : nary

tag "hgroup", see mdn

val hgroup' : nary'

tag "hgroup", see mdn

val html : nary

tag "html", see mdn

val html' : nary'

tag "html", see mdn

val i : nary

tag "i", see mdn

val i' : nary'

tag "i", see mdn

val iframe : nary

tag "iframe", see mdn

val iframe' : nary'

tag "iframe", see mdn

val ins : nary

tag "ins", see mdn

val ins' : nary'

tag "ins", see mdn

val kbd : nary

tag "kbd", see mdn

val kbd' : nary'

tag "kbd", see mdn

val label : nary

tag "label", see mdn

val label' : nary'

tag "label", see mdn

val legend : nary

tag "legend", see mdn

val legend' : nary'

tag "legend", see mdn

val li : nary

tag "li", see mdn

val li' : nary'

tag "li", see mdn

val main : nary

tag "main", see mdn

val main' : nary'

tag "main", see mdn

val map : nary

tag "map", see mdn

val map' : nary'

tag "map", see mdn

val mark : nary

tag "mark", see mdn

val mark' : nary'

tag "mark", see mdn

val math : nary

tag "math", see mdn

val math' : nary'

tag "math", see mdn

val menu : nary

tag "menu", see mdn

val menu' : nary'

tag "menu", see mdn

val meter : nary

tag "meter", see mdn

val meter' : nary'

tag "meter", see mdn

val nav : nary

tag "nav", see mdn

val nav' : nary'

tag "nav", see mdn

val noscript : nary

tag "noscript", see mdn

val noscript' : nary'

tag "noscript", see mdn

val object_ : nary

tag "object", see mdn

val object_' : nary'

tag "object", see mdn

val ol : nary

tag "ol", see mdn

val ol' : nary'

tag "ol", see mdn

val optgroup : nary

tag "optgroup", see mdn

val optgroup' : nary'

tag "optgroup", see mdn

val option : nary

tag "option", see mdn

val option' : nary'

tag "option", see mdn

val output : nary

tag "output", see mdn

val output' : nary'

tag "output", see mdn

val p : nary

tag "p", see mdn

val p' : nary'

tag "p", see mdn

val picture : nary

tag "picture", see mdn

val picture' : nary'

tag "picture", see mdn

val pre : nary

tag "pre", see mdn

val pre' : nary'

tag "pre", see mdn

val progress : nary

tag "progress", see mdn

val progress' : nary'

tag "progress", see mdn

val q : nary

tag "q", see mdn

val q' : nary'

tag "q", see mdn

val rb : nary

tag "rb", see mdn

val rb' : nary'

tag "rb", see mdn

val rp : nary

tag "rp", see mdn

val rp' : nary'

tag "rp", see mdn

val rt : nary

tag "rt", see mdn

val rt' : nary'

tag "rt", see mdn

val rtc : nary

tag "rtc", see mdn

val rtc' : nary'

tag "rtc", see mdn

val ruby : nary

tag "ruby", see mdn

val ruby' : nary'

tag "ruby", see mdn

val s : nary

tag "s", see mdn

val s' : nary'

tag "s", see mdn

val samp : nary

tag "samp", see mdn

val samp' : nary'

tag "samp", see mdn

val script : nary

tag "script", see mdn

val script' : nary'

tag "script", see mdn

val section : nary

tag "section", see mdn

val section' : nary'

tag "section", see mdn

val select : nary

tag "select", see mdn

val select' : nary'

tag "select", see mdn

val slot : nary

tag "slot", see mdn

val slot' : nary'

tag "slot", see mdn

val small : nary

tag "small", see mdn

val small' : nary'

tag "small", see mdn

val span : nary

tag "span", see mdn

val span' : nary'

tag "span", see mdn

val strong : nary

tag "strong", see mdn

val strong' : nary'

tag "strong", see mdn

val style : nary

tag "style", see mdn

val style' : nary'

tag "style", see mdn

val sub : nary

tag "sub", see mdn

val sub' : nary'

tag "sub", see mdn

val summary : nary

tag "summary", see mdn

val summary' : nary'

tag "summary", see mdn

val sup : nary

tag "sup", see mdn

val sup' : nary'

tag "sup", see mdn

val svg : nary

tag "svg", see mdn

val svg' : nary'

tag "svg", see mdn

val table : nary

tag "table", see mdn

val table' : nary'

tag "table", see mdn

val tbody : nary

tag "tbody", see mdn

val tbody' : nary'

tag "tbody", see mdn

val td : nary

tag "td", see mdn

val td' : nary'

tag "td", see mdn

val template : nary

tag "template", see mdn

val template' : nary'

tag "template", see mdn

val textarea : nary

tag "textarea", see mdn

val textarea' : nary'

tag "textarea", see mdn

val tfoot : nary

tag "tfoot", see mdn

val tfoot' : nary'

tag "tfoot", see mdn

val th : nary

tag "th", see mdn

val th' : nary'

tag "th", see mdn

val thead : nary

tag "thead", see mdn

val thead' : nary'

tag "thead", see mdn

val time : nary

tag "time", see mdn

val time' : nary'

tag "time", see mdn

val title : nary

tag "title", see mdn

val title' : nary'

tag "title", see mdn

val tr : nary

tag "tr", see mdn

val tr' : nary'

tag "tr", see mdn

val u : nary

tag "u", see mdn

val u' : nary'

tag "u", see mdn

val ul : nary

tag "ul", see mdn

val ul' : nary'

tag "ul", see mdn

val var : nary

tag "var", see mdn

val var' : nary'

tag "var", see mdn

val video : nary

tag "video", see mdn

val video' : nary'

tag "video", see mdn

Attributes.

val to_string : ?top:bool -> elt -> string

Convert a HTML element to a string.

  • parameter top

    if true, add DOCTYPE at the beginning. The top element should then be a "html" tag.

val to_string_l : elt list -> string

Convert a list of HTML elements to a string. This is designed for fragments of HTML that are to be injected inside a bigger context, as it's invalid to have multiple elements at the toplevel of a HTML document.

val to_string_top : elt -> string
val to_stream : elt -> Tiny_httpd_stream.t

Convert a HTML element to a stream. This might just convert it to a string first, do not assume it to be more efficient.

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_html_/A/index.html b/dev/tiny_httpd/Tiny_httpd_html_/A/index.html index 004d567b..0d6658ce 100644 --- a/dev/tiny_httpd/Tiny_httpd_html_/A/index.html +++ b/dev/tiny_httpd/Tiny_httpd_html_/A/index.html @@ -1,2 +1,2 @@ -A (tiny_httpd.Tiny_httpd_html_.A)

Module Tiny_httpd_html_.A

Attributes.

This module contains combinator for the standard attributes. One can also just use a pair of strings.

type t = string -> attribute

Attribute builder

val accept : t

Attribute "accept".

val accept_charset : t

Attribute "accept-charset".

val accesskey : t

Attribute "accesskey".

val action : t

Attribute "action".

val align : t

Attribute "align".

val allow : t

Attribute "allow".

val alt : t

Attribute "alt".

val async : t

Attribute "async".

val autocapitalize : t

Attribute "autocapitalize".

val autocomplete : t

Attribute "autocomplete".

val autofocus : t

Attribute "autofocus".

val autoplay : t

Attribute "autoplay".

val buffered : t

Attribute "buffered".

val capture : t

Attribute "capture".

val challenge : t

Attribute "challenge".

val charset : t

Attribute "charset".

val checked : t

Attribute "checked".

val cite : t

Attribute "cite".

val class_ : t

Attribute "class".

val code : t

Attribute "code".

val codebase : t

Attribute "codebase".

val cols : t

Attribute "cols".

val colspan : t

Attribute "colspan".

val content : t

Attribute "content".

val contenteditable : t

Attribute "contenteditable".

val contextmenu : t

Attribute "contextmenu".

val controls : t

Attribute "controls".

val coords : t

Attribute "coords".

val crossorigin : t

Attribute "crossorigin".

val csp : t

Attribute "csp".

val data : t

Attribute "data".

val data_star : t

Attribute "data-*".

val datetime : t

Attribute "datetime".

val decoding : t

Attribute "decoding".

val default : t

Attribute "default".

val defer : t

Attribute "defer".

val dir : t

Attribute "dir".

val dirname : t

Attribute "dirname".

val disabled : t

Attribute "disabled".

val download : t

Attribute "download".

val draggable : t

Attribute "draggable".

val enctype : t

Attribute "enctype".

val enterkeyhint : t

Attribute "enterkeyhint".

val for_ : t

Attribute "for".

val form : t

Attribute "form".

val formaction : t

Attribute "formaction".

val formenctype : t

Attribute "formenctype".

val formmethod : t

Attribute "formmethod".

val formnovalidate : t

Attribute "formnovalidate".

val formtarget : t

Attribute "formtarget".

val headers : t

Attribute "headers".

val hidden : t

Attribute "hidden".

val high : t

Attribute "high".

val href : t

Attribute "href".

val hreflang : t

Attribute "hreflang".

val http_equiv : t

Attribute "http-equiv".

val icon : t

Attribute "icon".

val id : t

Attribute "id".

val importance : t

Attribute "importance".

val integrity : t

Attribute "integrity".

val ismap : t

Attribute "ismap".

val itemprop : t

Attribute "itemprop".

val keytype : t

Attribute "keytype".

val kind : t

Attribute "kind".

val label : t

Attribute "label".

val lang : t

Attribute "lang".

val language : t

Attribute "language".

val list : t

Attribute "list".

val loop : t

Attribute "loop".

val low : t

Attribute "low".

val manifest : t

Attribute "manifest".

val max : t

Attribute "max".

val maxlength : t

Attribute "maxlength".

val minlength : t

Attribute "minlength".

val media : t

Attribute "media".

val method_ : t

Attribute "method".

val min : t

Attribute "min".

val multiple : t

Attribute "multiple".

val muted : t

Attribute "muted".

val name : t

Attribute "name".

val novalidate : t

Attribute "novalidate".

val open_ : t

Attribute "open".

val optimum : t

Attribute "optimum".

val pattern : t

Attribute "pattern".

val ping : t

Attribute "ping".

val placeholder : t

Attribute "placeholder".

val poster : t

Attribute "poster".

val preload : t

Attribute "preload".

val radiogroup : t

Attribute "radiogroup".

val readonly : t

Attribute "readonly".

val referrerpolicy : t

Attribute "referrerpolicy".

val rel : t

Attribute "rel".

val required : t

Attribute "required".

val reversed : t

Attribute "reversed".

val rows : t

Attribute "rows".

val rowspan : t

Attribute "rowspan".

val sandbox : t

Attribute "sandbox".

val scope : t

Attribute "scope".

val scoped : t

Attribute "scoped".

val selected : t

Attribute "selected".

val shape : t

Attribute "shape".

val size : t

Attribute "size".

val sizes : t

Attribute "sizes".

val slot : t

Attribute "slot".

val span : t

Attribute "span".

val spellcheck : t

Attribute "spellcheck".

val src : t

Attribute "src".

val srcdoc : t

Attribute "srcdoc".

val srclang : t

Attribute "srclang".

val srcset : t

Attribute "srcset".

val start : t

Attribute "start".

val step : t

Attribute "step".

val style : t

Attribute "style".

val summary : t

Attribute "summary".

val tabindex : t

Attribute "tabindex".

val target : t

Attribute "target".

val title : t

Attribute "title".

val translate : t

Attribute "translate".

val text : t

Attribute "Text".

val type_ : t

Attribute "type".

val usemap : t

Attribute "usemap".

val value : t

Attribute "value".

val width : t

Attribute "width".

val wrap : t

Attribute "wrap".

\ No newline at end of file +A (tiny_httpd.Tiny_httpd_html_.A)

Module Tiny_httpd_html_.A

Attributes.

This module contains combinator for the standard attributes. One can also just use a pair of strings.

type t = string -> attribute

Attribute builder

val accept : t

Attribute "accept".

val accept_charset : t

Attribute "accept-charset".

val accesskey : t

Attribute "accesskey".

val action : t

Attribute "action".

val align : t

Attribute "align".

val allow : t

Attribute "allow".

val alt : t

Attribute "alt".

val async : t

Attribute "async".

val autocapitalize : t

Attribute "autocapitalize".

val autocomplete : t

Attribute "autocomplete".

val autofocus : t

Attribute "autofocus".

val autoplay : t

Attribute "autoplay".

val buffered : t

Attribute "buffered".

val capture : t

Attribute "capture".

val challenge : t

Attribute "challenge".

val charset : t

Attribute "charset".

val checked : t

Attribute "checked".

val cite : t

Attribute "cite".

val class_ : t

Attribute "class".

val code : t

Attribute "code".

val codebase : t

Attribute "codebase".

val cols : t

Attribute "cols".

val colspan : t

Attribute "colspan".

val content : t

Attribute "content".

val contenteditable : t

Attribute "contenteditable".

val contextmenu : t

Attribute "contextmenu".

val controls : t

Attribute "controls".

val coords : t

Attribute "coords".

val crossorigin : t

Attribute "crossorigin".

val csp : t

Attribute "csp".

val data : t

Attribute "data".

val data_star : t

Attribute "data-*".

val datetime : t

Attribute "datetime".

val decoding : t

Attribute "decoding".

val default : t

Attribute "default".

val defer : t

Attribute "defer".

val dir : t

Attribute "dir".

val dirname : t

Attribute "dirname".

val disabled : t

Attribute "disabled".

val download : t

Attribute "download".

val draggable : t

Attribute "draggable".

val enctype : t

Attribute "enctype".

val enterkeyhint : t

Attribute "enterkeyhint".

val for_ : t

Attribute "for".

val form : t

Attribute "form".

val formaction : t

Attribute "formaction".

val formenctype : t

Attribute "formenctype".

val formmethod : t

Attribute "formmethod".

val formnovalidate : t

Attribute "formnovalidate".

val formtarget : t

Attribute "formtarget".

val headers : t

Attribute "headers".

val hidden : t

Attribute "hidden".

val high : t

Attribute "high".

val href : t

Attribute "href".

val hreflang : t

Attribute "hreflang".

val http_equiv : t

Attribute "http-equiv".

val icon : t

Attribute "icon".

val id : t

Attribute "id".

val importance : t

Attribute "importance".

val integrity : t

Attribute "integrity".

val ismap : t

Attribute "ismap".

val itemprop : t

Attribute "itemprop".

val keytype : t

Attribute "keytype".

val kind : t

Attribute "kind".

val label : t

Attribute "label".

val lang : t

Attribute "lang".

val language : t

Attribute "language".

val list : t

Attribute "list".

val loop : t

Attribute "loop".

val low : t

Attribute "low".

val manifest : t

Attribute "manifest".

val max : t

Attribute "max".

val maxlength : t

Attribute "maxlength".

val minlength : t

Attribute "minlength".

val media : t

Attribute "media".

val method_ : t

Attribute "method".

val min : t

Attribute "min".

val multiple : t

Attribute "multiple".

val muted : t

Attribute "muted".

val name : t

Attribute "name".

val novalidate : t

Attribute "novalidate".

val open_ : t

Attribute "open".

val optimum : t

Attribute "optimum".

val pattern : t

Attribute "pattern".

val ping : t

Attribute "ping".

val placeholder : t

Attribute "placeholder".

val poster : t

Attribute "poster".

val preload : t

Attribute "preload".

val radiogroup : t

Attribute "radiogroup".

val readonly : t

Attribute "readonly".

val referrerpolicy : t

Attribute "referrerpolicy".

val rel : t

Attribute "rel".

val required : t

Attribute "required".

val reversed : t

Attribute "reversed".

val rows : t

Attribute "rows".

val rowspan : t

Attribute "rowspan".

val sandbox : t

Attribute "sandbox".

val scope : t

Attribute "scope".

val scoped : t

Attribute "scoped".

val selected : t

Attribute "selected".

val shape : t

Attribute "shape".

val size : t

Attribute "size".

val sizes : t

Attribute "sizes".

val slot : t

Attribute "slot".

val span : t

Attribute "span".

val spellcheck : t

Attribute "spellcheck".

val src : t

Attribute "src".

val srcdoc : t

Attribute "srcdoc".

val srclang : t

Attribute "srclang".

val srcset : t

Attribute "srcset".

val start : t

Attribute "start".

val step : t

Attribute "step".

val style : t

Attribute "style".

val summary : t

Attribute "summary".

val tabindex : t

Attribute "tabindex".

val target : t

Attribute "target".

val title : t

Attribute "title".

val translate : t

Attribute "translate".

val text : t

Attribute "Text".

val type_ : t

Attribute "type".

val usemap : t

Attribute "usemap".

val value : t

Attribute "value".

val width : t

Attribute "width".

val wrap : t

Attribute "wrap".

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_html_/Out/index.html b/dev/tiny_httpd/Tiny_httpd_html_/Out/index.html index 419c4631..bf3ffac4 100644 --- a/dev/tiny_httpd/Tiny_httpd_html_/Out/index.html +++ b/dev/tiny_httpd/Tiny_httpd_html_/Out/index.html @@ -1,2 +1,2 @@ -Out (tiny_httpd.Tiny_httpd_html_.Out)

Module Tiny_httpd_html_.Out

Output for HTML combinators.

This output type is used to produce a string reasonably efficiently from a tree of combinators.

  • since 0.12
type t
val create : unit -> t
val clear : t -> unit
val add_char : t -> char -> unit
val add_string : t -> string -> unit
val add_format_nl : t -> unit
val with_no_format_nl : t -> ( unit -> 'a ) -> 'a
val to_string : t -> string
\ No newline at end of file +Out (tiny_httpd.Tiny_httpd_html_.Out)

Module Tiny_httpd_html_.Out

Output for HTML combinators.

This output type is used to produce a string reasonably efficiently from a tree of combinators.

  • since 0.12
type t
val create : unit -> t
val clear : t -> unit
val add_char : t -> char -> unit
val add_string : t -> string -> unit
val add_format_nl : t -> unit
val with_no_format_nl : t -> ( unit -> 'a ) -> 'a
val to_string : t -> string
\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_html_/index.html b/dev/tiny_httpd/Tiny_httpd_html_/index.html index c59d0044..7b4b1364 100644 --- a/dev/tiny_httpd/Tiny_httpd_html_/index.html +++ b/dev/tiny_httpd/Tiny_httpd_html_/index.html @@ -1,4 +1,4 @@ -Tiny_httpd_html_ (tiny_httpd.Tiny_httpd_html_)

Module Tiny_httpd_html_

module Out : sig ... end

Output for HTML combinators.

type attribute = string * string

An attribute, i.e. a key/value pair

type elt = Out.t -> unit

A html element. It is represented by its output function, so we can directly print it.

type void = ?if_:bool -> attribute list -> elt

Element without children.

type nary = ?if_:bool -> attribute list -> elt list -> elt

Element with children, represented as a list.

  • parameter if_

    if false, do not print anything (default true)

type sub_elt = [
| `E of elt
| `L of elt list
| `S of elt Stdlib.Seq.t
| `Nil
]

A chunk of sub-elements, possibly empty.

type nary' = ?if_:bool -> attribute list -> sub_elt list -> elt

Element with children, represented as a list of sub_elt to be flattened

  • parameter if_

    if false, do not print anything (default true)

val sub_e : elt -> sub_elt

Sub-element with a single element inside.

val sub_l : elt list -> sub_elt

Sub-element with a list of items inside.

val sub_seq : elt Stdlib.Seq.t -> sub_elt

Sub-element with a sequence (Seq.t) of items inside.

val seq_of_array : 'a array -> 'a Stdlib.Seq.t

Helper to build a Seq.t from an array.

val sub_empty : sub_elt

Sub-element with nothing inside. Useful in conditionals, when one decides not to emit a sub-element at all.

val txt : string -> elt

Emit a string value, which will be escaped.

val txtf : +Tiny_httpd_html_ (tiny_httpd.Tiny_httpd_html_)

Module Tiny_httpd_html_

module Out : sig ... end

Output for HTML combinators.

type attribute = string * string

An attribute, i.e. a key/value pair

type elt = Out.t -> unit

A html element. It is represented by its output function, so we can directly print it.

type void = ?if_:bool -> attribute list -> elt

Element without children.

type nary = ?if_:bool -> attribute list -> elt list -> elt

Element with children, represented as a list.

  • parameter if_

    if false, do not print anything (default true)

type sub_elt = [
| `E of elt
| `L of elt list
| `S of elt Stdlib.Seq.t
| `Nil
]

A chunk of sub-elements, possibly empty.

type nary' = ?if_:bool -> attribute list -> sub_elt list -> elt

Element with children, represented as a list of sub_elt to be flattened

  • parameter if_

    if false, do not print anything (default true)

val sub_e : elt -> sub_elt

Sub-element with a single element inside.

val sub_l : elt list -> sub_elt

Sub-element with a list of items inside.

val sub_seq : elt Stdlib.Seq.t -> sub_elt

Sub-element with a sequence (Seq.t) of items inside.

val seq_of_array : 'a array -> 'b Stdlib.Seq.t

Helper to build a Seq.t from an array.

val sub_empty : sub_elt

Sub-element with nothing inside. Useful in conditionals, when one decides not to emit a sub-element at all.

val txt : string -> elt

Emit a string value, which will be escaped.

val txtf : ( 'a, Stdlib.Format.formatter, unit, Out.t -> unit ) Stdlib.format4 -> - 'a

Formatted version of txt

val raw_html : string -> elt

Emit raw HTML. Caution, this can lead to injection vulnerabilities, never use with text that comes from untrusted users.

val area : void

tag "area", see mdn

val base : void

tag "base", see mdn

val br : void

tag "br", see mdn

val col : void

tag "col", see mdn

val embed : void

tag "embed", see mdn

val hr : void

tag "hr", see mdn

val img : void

tag "img", see mdn

val input : void

tag "input", see mdn

tag "link", see mdn

val menuitem : void

tag "menuitem", see mdn

val meta : void

tag "meta", see mdn

val param : void

tag "param", see mdn

val source : void

tag "source", see mdn

val track : void

tag "track", see mdn

val wbr : void

tag "wbr", see mdn

val a : nary

tag "a", see mdn

val a' : nary'

tag "a", see mdn

val abbr : nary

tag "abbr", see mdn

val abbr' : nary'

tag "abbr", see mdn

val address : nary

tag "address", see mdn

val address' : nary'

tag "address", see mdn

val article : nary

tag "article", see mdn

val article' : nary'

tag "article", see mdn

val aside : nary

tag "aside", see mdn

val aside' : nary'

tag "aside", see mdn

val audio : nary

tag "audio", see mdn

val audio' : nary'

tag "audio", see mdn

val b : nary

tag "b", see mdn

val b' : nary'

tag "b", see mdn

val bdi : nary

tag "bdi", see mdn

val bdi' : nary'

tag "bdi", see mdn

val bdo : nary

tag "bdo", see mdn

val bdo' : nary'

tag "bdo", see mdn

val blockquote : nary

tag "blockquote", see mdn

val blockquote' : nary'

tag "blockquote", see mdn

val body : nary

tag "body", see mdn

val body' : nary'

tag "body", see mdn

val button : nary

tag "button", see mdn

val button' : nary'

tag "button", see mdn

val canvas : nary

tag "canvas", see mdn

val canvas' : nary'

tag "canvas", see mdn

val caption : nary

tag "caption", see mdn

val caption' : nary'

tag "caption", see mdn

val cite : nary

tag "cite", see mdn

val cite' : nary'

tag "cite", see mdn

val code : nary

tag "code", see mdn

val code' : nary'

tag "code", see mdn

val colgroup : nary

tag "colgroup", see mdn

val colgroup' : nary'

tag "colgroup", see mdn

val data : nary

tag "data", see mdn

val data' : nary'

tag "data", see mdn

val datalist : nary

tag "datalist", see mdn

val datalist' : nary'

tag "datalist", see mdn

val dd : nary

tag "dd", see mdn

val dd' : nary'

tag "dd", see mdn

val del : nary

tag "del", see mdn

val del' : nary'

tag "del", see mdn

val details : nary

tag "details", see mdn

val details' : nary'

tag "details", see mdn

val dfn : nary

tag "dfn", see mdn

val dfn' : nary'

tag "dfn", see mdn

val dialog : nary

tag "dialog", see mdn

val dialog' : nary'

tag "dialog", see mdn

val div : nary

tag "div", see mdn

val div' : nary'

tag "div", see mdn

val dl : nary

tag "dl", see mdn

val dl' : nary'

tag "dl", see mdn

val dt : nary

tag "dt", see mdn

val dt' : nary'

tag "dt", see mdn

val em : nary

tag "em", see mdn

val em' : nary'

tag "em", see mdn

val fieldset : nary

tag "fieldset", see mdn

val fieldset' : nary'

tag "fieldset", see mdn

val figcaption : nary

tag "figcaption", see mdn

val figcaption' : nary'

tag "figcaption", see mdn

val figure : nary

tag "figure", see mdn

val figure' : nary'

tag "figure", see mdn

tag "footer", see mdn

val footer' : nary'

tag "footer", see mdn

val form : nary

tag "form", see mdn

val form' : nary'

tag "form", see mdn

val h1 : nary

tag "h1", see mdn

val h1' : nary'

tag "h1", see mdn

val h2 : nary

tag "h2", see mdn

val h2' : nary'

tag "h2", see mdn

val h3 : nary

tag "h3", see mdn

val h3' : nary'

tag "h3", see mdn

val h4 : nary

tag "h4", see mdn

val h4' : nary'

tag "h4", see mdn

val h5 : nary

tag "h5", see mdn

val h5' : nary'

tag "h5", see mdn

val h6 : nary

tag "h6", see mdn

val h6' : nary'

tag "h6", see mdn

val head : nary

tag "head", see mdn

val head' : nary'

tag "head", see mdn

val header : nary

tag "header", see mdn

val header' : nary'

tag "header", see mdn

val hgroup : nary

tag "hgroup", see mdn

val hgroup' : nary'

tag "hgroup", see mdn

val html : nary

tag "html", see mdn

val html' : nary'

tag "html", see mdn

val i : nary

tag "i", see mdn

val i' : nary'

tag "i", see mdn

val iframe : nary

tag "iframe", see mdn

val iframe' : nary'

tag "iframe", see mdn

val ins : nary

tag "ins", see mdn

val ins' : nary'

tag "ins", see mdn

val kbd : nary

tag "kbd", see mdn

val kbd' : nary'

tag "kbd", see mdn

val label : nary

tag "label", see mdn

val label' : nary'

tag "label", see mdn

val legend : nary

tag "legend", see mdn

val legend' : nary'

tag "legend", see mdn

val li : nary

tag "li", see mdn

val li' : nary'

tag "li", see mdn

val main : nary

tag "main", see mdn

val main' : nary'

tag "main", see mdn

val map : nary

tag "map", see mdn

val map' : nary'

tag "map", see mdn

val mark : nary

tag "mark", see mdn

val mark' : nary'

tag "mark", see mdn

val math : nary

tag "math", see mdn

val math' : nary'

tag "math", see mdn

val menu : nary

tag "menu", see mdn

val menu' : nary'

tag "menu", see mdn

val meter : nary

tag "meter", see mdn

val meter' : nary'

tag "meter", see mdn

val nav : nary

tag "nav", see mdn

val nav' : nary'

tag "nav", see mdn

val noscript : nary

tag "noscript", see mdn

val noscript' : nary'

tag "noscript", see mdn

val object_ : nary

tag "object", see mdn

val object_' : nary'

tag "object", see mdn

val ol : nary

tag "ol", see mdn

val ol' : nary'

tag "ol", see mdn

val optgroup : nary

tag "optgroup", see mdn

val optgroup' : nary'

tag "optgroup", see mdn

val option : nary

tag "option", see mdn

val option' : nary'

tag "option", see mdn

val output : nary

tag "output", see mdn

val output' : nary'

tag "output", see mdn

val p : nary

tag "p", see mdn

val p' : nary'

tag "p", see mdn

val picture : nary

tag "picture", see mdn

val picture' : nary'

tag "picture", see mdn

val pre : nary

tag "pre", see mdn

val pre' : nary'

tag "pre", see mdn

val progress : nary

tag "progress", see mdn

val progress' : nary'

tag "progress", see mdn

val q : nary

tag "q", see mdn

val q' : nary'

tag "q", see mdn

val rb : nary

tag "rb", see mdn

val rb' : nary'

tag "rb", see mdn

val rp : nary

tag "rp", see mdn

val rp' : nary'

tag "rp", see mdn

val rt : nary

tag "rt", see mdn

val rt' : nary'

tag "rt", see mdn

val rtc : nary

tag "rtc", see mdn

val rtc' : nary'

tag "rtc", see mdn

val ruby : nary

tag "ruby", see mdn

val ruby' : nary'

tag "ruby", see mdn

val s : nary

tag "s", see mdn

val s' : nary'

tag "s", see mdn

val samp : nary

tag "samp", see mdn

val samp' : nary'

tag "samp", see mdn

val script : nary

tag "script", see mdn

val script' : nary'

tag "script", see mdn

val section : nary

tag "section", see mdn

val section' : nary'

tag "section", see mdn

val select : nary

tag "select", see mdn

val select' : nary'

tag "select", see mdn

val slot : nary

tag "slot", see mdn

val slot' : nary'

tag "slot", see mdn

val small : nary

tag "small", see mdn

val small' : nary'

tag "small", see mdn

val span : nary

tag "span", see mdn

val span' : nary'

tag "span", see mdn

val strong : nary

tag "strong", see mdn

val strong' : nary'

tag "strong", see mdn

val style : nary

tag "style", see mdn

val style' : nary'

tag "style", see mdn

val sub : nary

tag "sub", see mdn

val sub' : nary'

tag "sub", see mdn

val summary : nary

tag "summary", see mdn

val summary' : nary'

tag "summary", see mdn

val sup : nary

tag "sup", see mdn

val sup' : nary'

tag "sup", see mdn

val svg : nary

tag "svg", see mdn

val svg' : nary'

tag "svg", see mdn

val table : nary

tag "table", see mdn

val table' : nary'

tag "table", see mdn

val tbody : nary

tag "tbody", see mdn

val tbody' : nary'

tag "tbody", see mdn

val td : nary

tag "td", see mdn

val td' : nary'

tag "td", see mdn

val template : nary

tag "template", see mdn

val template' : nary'

tag "template", see mdn

val textarea : nary

tag "textarea", see mdn

val textarea' : nary'

tag "textarea", see mdn

val tfoot : nary

tag "tfoot", see mdn

val tfoot' : nary'

tag "tfoot", see mdn

val th : nary

tag "th", see mdn

val th' : nary'

tag "th", see mdn

val thead : nary

tag "thead", see mdn

val thead' : nary'

tag "thead", see mdn

val time : nary

tag "time", see mdn

val time' : nary'

tag "time", see mdn

val title : nary

tag "title", see mdn

val title' : nary'

tag "title", see mdn

val tr : nary

tag "tr", see mdn

val tr' : nary'

tag "tr", see mdn

val u : nary

tag "u", see mdn

val u' : nary'

tag "u", see mdn

val ul : nary

tag "ul", see mdn

val ul' : nary'

tag "ul", see mdn

val var : nary

tag "var", see mdn

val var' : nary'

tag "var", see mdn

val video : nary

tag "video", see mdn

val video' : nary'

tag "video", see mdn

module A : sig ... end

Attributes.

\ No newline at end of file + 'b

Formatted version of txt

val raw_html : string -> elt

Emit raw HTML. Caution, this can lead to injection vulnerabilities, never use with text that comes from untrusted users.

val area : void

tag "area", see mdn

val base : void

tag "base", see mdn

val br : void

tag "br", see mdn

val col : void

tag "col", see mdn

val embed : void

tag "embed", see mdn

val hr : void

tag "hr", see mdn

val img : void

tag "img", see mdn

val input : void

tag "input", see mdn

tag "link", see mdn

val menuitem : void

tag "menuitem", see mdn

val meta : void

tag "meta", see mdn

val param : void

tag "param", see mdn

val source : void

tag "source", see mdn

val track : void

tag "track", see mdn

val wbr : void

tag "wbr", see mdn

val a : nary

tag "a", see mdn

val a' : nary'

tag "a", see mdn

val abbr : nary

tag "abbr", see mdn

val abbr' : nary'

tag "abbr", see mdn

val address : nary

tag "address", see mdn

val address' : nary'

tag "address", see mdn

val article : nary

tag "article", see mdn

val article' : nary'

tag "article", see mdn

val aside : nary

tag "aside", see mdn

val aside' : nary'

tag "aside", see mdn

val audio : nary

tag "audio", see mdn

val audio' : nary'

tag "audio", see mdn

val b : nary

tag "b", see mdn

val b' : nary'

tag "b", see mdn

val bdi : nary

tag "bdi", see mdn

val bdi' : nary'

tag "bdi", see mdn

val bdo : nary

tag "bdo", see mdn

val bdo' : nary'

tag "bdo", see mdn

val blockquote : nary

tag "blockquote", see mdn

val blockquote' : nary'

tag "blockquote", see mdn

val body : nary

tag "body", see mdn

val body' : nary'

tag "body", see mdn

val button : nary

tag "button", see mdn

val button' : nary'

tag "button", see mdn

val canvas : nary

tag "canvas", see mdn

val canvas' : nary'

tag "canvas", see mdn

val caption : nary

tag "caption", see mdn

val caption' : nary'

tag "caption", see mdn

val cite : nary

tag "cite", see mdn

val cite' : nary'

tag "cite", see mdn

val code : nary

tag "code", see mdn

val code' : nary'

tag "code", see mdn

val colgroup : nary

tag "colgroup", see mdn

val colgroup' : nary'

tag "colgroup", see mdn

val data : nary

tag "data", see mdn

val data' : nary'

tag "data", see mdn

val datalist : nary

tag "datalist", see mdn

val datalist' : nary'

tag "datalist", see mdn

val dd : nary

tag "dd", see mdn

val dd' : nary'

tag "dd", see mdn

val del : nary

tag "del", see mdn

val del' : nary'

tag "del", see mdn

val details : nary

tag "details", see mdn

val details' : nary'

tag "details", see mdn

val dfn : nary

tag "dfn", see mdn

val dfn' : nary'

tag "dfn", see mdn

val dialog : nary

tag "dialog", see mdn

val dialog' : nary'

tag "dialog", see mdn

val div : nary

tag "div", see mdn

val div' : nary'

tag "div", see mdn

val dl : nary

tag "dl", see mdn

val dl' : nary'

tag "dl", see mdn

val dt : nary

tag "dt", see mdn

val dt' : nary'

tag "dt", see mdn

val em : nary

tag "em", see mdn

val em' : nary'

tag "em", see mdn

val fieldset : nary

tag "fieldset", see mdn

val fieldset' : nary'

tag "fieldset", see mdn

val figcaption : nary

tag "figcaption", see mdn

val figcaption' : nary'

tag "figcaption", see mdn

val figure : nary

tag "figure", see mdn

val figure' : nary'

tag "figure", see mdn

tag "footer", see mdn

val footer' : nary'

tag "footer", see mdn

val form : nary

tag "form", see mdn

val form' : nary'

tag "form", see mdn

val h1 : nary

tag "h1", see mdn

val h1' : nary'

tag "h1", see mdn

val h2 : nary

tag "h2", see mdn

val h2' : nary'

tag "h2", see mdn

val h3 : nary

tag "h3", see mdn

val h3' : nary'

tag "h3", see mdn

val h4 : nary

tag "h4", see mdn

val h4' : nary'

tag "h4", see mdn

val h5 : nary

tag "h5", see mdn

val h5' : nary'

tag "h5", see mdn

val h6 : nary

tag "h6", see mdn

val h6' : nary'

tag "h6", see mdn

val head : nary

tag "head", see mdn

val head' : nary'

tag "head", see mdn

val header : nary

tag "header", see mdn

val header' : nary'

tag "header", see mdn

val hgroup : nary

tag "hgroup", see mdn

val hgroup' : nary'

tag "hgroup", see mdn

val html : nary

tag "html", see mdn

val html' : nary'

tag "html", see mdn

val i : nary

tag "i", see mdn

val i' : nary'

tag "i", see mdn

val iframe : nary

tag "iframe", see mdn

val iframe' : nary'

tag "iframe", see mdn

val ins : nary

tag "ins", see mdn

val ins' : nary'

tag "ins", see mdn

val kbd : nary

tag "kbd", see mdn

val kbd' : nary'

tag "kbd", see mdn

val label : nary

tag "label", see mdn

val label' : nary'

tag "label", see mdn

val legend : nary

tag "legend", see mdn

val legend' : nary'

tag "legend", see mdn

val li : nary

tag "li", see mdn

val li' : nary'

tag "li", see mdn

val main : nary

tag "main", see mdn

val main' : nary'

tag "main", see mdn

val map : nary

tag "map", see mdn

val map' : nary'

tag "map", see mdn

val mark : nary

tag "mark", see mdn

val mark' : nary'

tag "mark", see mdn

val math : nary

tag "math", see mdn

val math' : nary'

tag "math", see mdn

val menu : nary

tag "menu", see mdn

val menu' : nary'

tag "menu", see mdn

val meter : nary

tag "meter", see mdn

val meter' : nary'

tag "meter", see mdn

val nav : nary

tag "nav", see mdn

val nav' : nary'

tag "nav", see mdn

val noscript : nary

tag "noscript", see mdn

val noscript' : nary'

tag "noscript", see mdn

val object_ : nary

tag "object", see mdn

val object_' : nary'

tag "object", see mdn

val ol : nary

tag "ol", see mdn

val ol' : nary'

tag "ol", see mdn

val optgroup : nary

tag "optgroup", see mdn

val optgroup' : nary'

tag "optgroup", see mdn

val option : nary

tag "option", see mdn

val option' : nary'

tag "option", see mdn

val output : nary

tag "output", see mdn

val output' : nary'

tag "output", see mdn

val p : nary

tag "p", see mdn

val p' : nary'

tag "p", see mdn

val picture : nary

tag "picture", see mdn

val picture' : nary'

tag "picture", see mdn

val pre : nary

tag "pre", see mdn

val pre' : nary'

tag "pre", see mdn

val progress : nary

tag "progress", see mdn

val progress' : nary'

tag "progress", see mdn

val q : nary

tag "q", see mdn

val q' : nary'

tag "q", see mdn

val rb : nary

tag "rb", see mdn

val rb' : nary'

tag "rb", see mdn

val rp : nary

tag "rp", see mdn

val rp' : nary'

tag "rp", see mdn

val rt : nary

tag "rt", see mdn

val rt' : nary'

tag "rt", see mdn

val rtc : nary

tag "rtc", see mdn

val rtc' : nary'

tag "rtc", see mdn

val ruby : nary

tag "ruby", see mdn

val ruby' : nary'

tag "ruby", see mdn

val s : nary

tag "s", see mdn

val s' : nary'

tag "s", see mdn

val samp : nary

tag "samp", see mdn

val samp' : nary'

tag "samp", see mdn

val script : nary

tag "script", see mdn

val script' : nary'

tag "script", see mdn

val section : nary

tag "section", see mdn

val section' : nary'

tag "section", see mdn

val select : nary

tag "select", see mdn

val select' : nary'

tag "select", see mdn

val slot : nary

tag "slot", see mdn

val slot' : nary'

tag "slot", see mdn

val small : nary

tag "small", see mdn

val small' : nary'

tag "small", see mdn

val span : nary

tag "span", see mdn

val span' : nary'

tag "span", see mdn

val strong : nary

tag "strong", see mdn

val strong' : nary'

tag "strong", see mdn

val style : nary

tag "style", see mdn

val style' : nary'

tag "style", see mdn

val sub : nary

tag "sub", see mdn

val sub' : nary'

tag "sub", see mdn

val summary : nary

tag "summary", see mdn

val summary' : nary'

tag "summary", see mdn

val sup : nary

tag "sup", see mdn

val sup' : nary'

tag "sup", see mdn

val svg : nary

tag "svg", see mdn

val svg' : nary'

tag "svg", see mdn

val table : nary

tag "table", see mdn

val table' : nary'

tag "table", see mdn

val tbody : nary

tag "tbody", see mdn

val tbody' : nary'

tag "tbody", see mdn

val td : nary

tag "td", see mdn

val td' : nary'

tag "td", see mdn

val template : nary

tag "template", see mdn

val template' : nary'

tag "template", see mdn

val textarea : nary

tag "textarea", see mdn

val textarea' : nary'

tag "textarea", see mdn

val tfoot : nary

tag "tfoot", see mdn

val tfoot' : nary'

tag "tfoot", see mdn

val th : nary

tag "th", see mdn

val th' : nary'

tag "th", see mdn

val thead : nary

tag "thead", see mdn

val thead' : nary'

tag "thead", see mdn

val time : nary

tag "time", see mdn

val time' : nary'

tag "time", see mdn

val title : nary

tag "title", see mdn

val title' : nary'

tag "title", see mdn

val tr : nary

tag "tr", see mdn

val tr' : nary'

tag "tr", see mdn

val u : nary

tag "u", see mdn

val u' : nary'

tag "u", see mdn

val ul : nary

tag "ul", see mdn

val ul' : nary'

tag "ul", see mdn

val var : nary

tag "var", see mdn

val var' : nary'

tag "var", see mdn

val video : nary

tag "video", see mdn

val video' : nary'

tag "video", see mdn

module A : sig ... end

Attributes.

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_server/Headers/index.html b/dev/tiny_httpd/Tiny_httpd_server/Headers/index.html index 1bd19b53..1b839300 100644 --- a/dev/tiny_httpd/Tiny_httpd_server/Headers/index.html +++ b/dev/tiny_httpd/Tiny_httpd_server/Headers/index.html @@ -1,2 +1,2 @@ -Headers (tiny_httpd.Tiny_httpd_server.Headers)

Module Tiny_httpd_server.Headers

type t = (string * string) list

The header files of a request or response.

Neither the key nor the value can contain '\r' or '\n'. See https://tools.ietf.org/html/rfc7230#section-3.2

val empty : t

Empty list of headers

  • since 0.5
val get : ?f:( string -> string ) -> string -> t -> string option

get k headers looks for the header field with key k.

  • parameter f

    if provided, will transform the value before it is returned.

val set : string -> string -> t -> t

set k v headers sets the key k to value v. It erases any previous entry for k

val remove : string -> t -> t

Remove the key from the headers, if present.

val contains : string -> t -> bool

Is there a header with the given key?

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

Pretty print the headers.

\ No newline at end of file +Headers (tiny_httpd.Tiny_httpd_server.Headers)

Module Tiny_httpd_server.Headers

type t = (string * string) list

The header files of a request or response.

Neither the key nor the value can contain '\r' or '\n'. See https://tools.ietf.org/html/rfc7230#section-3.2

val empty : t

Empty list of headers

  • since 0.5
val get : ?f:( string -> string ) -> string -> t -> string option

get k headers looks for the header field with key k.

  • parameter f

    if provided, will transform the value before it is returned.

val set : string -> string -> t -> t

set k v headers sets the key k to value v. It erases any previous entry for k

val remove : string -> t -> t

Remove the key from the headers, if present.

val contains : string -> t -> bool

Is there a header with the given key?

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

Pretty print the headers.

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_server/Meth/index.html b/dev/tiny_httpd/Tiny_httpd_server/Meth/index.html index 532d824d..b0eaf5d0 100644 --- a/dev/tiny_httpd/Tiny_httpd_server/Meth/index.html +++ b/dev/tiny_httpd/Tiny_httpd_server/Meth/index.html @@ -1,2 +1,2 @@ -Meth (tiny_httpd.Tiny_httpd_server.Meth)

Module Tiny_httpd_server.Meth

type t = [
| `GET
| `PUT
| `POST
| `HEAD
| `DELETE
]

A HTTP method. For now we only handle a subset of these.

See https://tools.ietf.org/html/rfc7231#section-4

val pp : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
\ No newline at end of file +Meth (tiny_httpd.Tiny_httpd_server.Meth)

Module Tiny_httpd_server.Meth

type t = [
| `GET
| `PUT
| `POST
| `HEAD
| `DELETE
]

A HTTP method. For now we only handle a subset of these.

See https://tools.ietf.org/html/rfc7231#section-4

val pp : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_server/Middleware/index.html b/dev/tiny_httpd/Tiny_httpd_server/Middleware/index.html index 6ee77bd2..fde69850 100644 --- a/dev/tiny_httpd/Tiny_httpd_server/Middleware/index.html +++ b/dev/tiny_httpd/Tiny_httpd_server/Middleware/index.html @@ -1,2 +1,2 @@ -Middleware (tiny_httpd.Tiny_httpd_server.Middleware)

Module Tiny_httpd_server.Middleware

Middlewares

A middleware can be inserted in a handler to modify or observe its behavior.

  • since 0.11
type handler = byte_stream Request.t -> resp:( Response.t -> unit ) -> unit

Handlers are functions returning a response to a request. The response can be delayed, hence the use of a continuation as the resp parameter.

type t = handler -> handler

A middleware is a handler transformation.

It takes the existing handler h, and returns a new one which, given a query, modify it or log it before passing it to h, or fail. It can also log or modify or drop the response.

val nil : t

Trivial middleware that does nothing.

\ No newline at end of file +Middleware (tiny_httpd.Tiny_httpd_server.Middleware)

Module Tiny_httpd_server.Middleware

Middlewares

A middleware can be inserted in a handler to modify or observe its behavior.

  • since 0.11
type handler = byte_stream Request.t -> resp:( Response.t -> unit ) -> unit

Handlers are functions returning a response to a request. The response can be delayed, hence the use of a continuation as the resp parameter.

type t = handler -> handler

A middleware is a handler transformation.

It takes the existing handler h, and returns a new one which, given a query, modify it or log it before passing it to h, or fail. It can also log or modify or drop the response.

val nil : t

Trivial middleware that does nothing.

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_server/Request/index.html b/dev/tiny_httpd/Tiny_httpd_server/Request/index.html index 6ee8034b..8a2cecf7 100644 --- a/dev/tiny_httpd/Tiny_httpd_server/Request/index.html +++ b/dev/tiny_httpd/Tiny_httpd_server/Request/index.html @@ -1,2 +1,2 @@ -Request (tiny_httpd.Tiny_httpd_server.Request)

Module Tiny_httpd_server.Request

type 'body t = private {
meth : Meth.t;
host : string;
headers : Headers.t;
http_version : int * int;
path : string;
path_components : string list;
query : (string * string) list;
body : 'body;
start_time : float;(*

Obtained via get_time_s in create

  • since 0.11
*)
}

A request with method, path, host, headers, and a body, sent by a client.

The body is polymorphic because the request goes through several transformations. First it has no body, as only the request and headers are read; then it has a stream body; then the body might be entirely read as a string via read_body_full.

  • since 0.6 The field [query] was added and contains the query parameters in ["?foo=bar,x=y"]
  • since 0.6 The field [path_components] is the part of the path that precedes [query] and is split on ["/"].
  • since 0.11 the type is a private alias
  • since 0.11 the field [start_time] was added
val pp : Stdlib.Format.formatter -> string t -> unit

Pretty print the request and its body

val pp_ : Stdlib.Format.formatter -> _ t -> unit

Pretty print the request without its body

val headers : _ t -> Headers.t

List of headers of the request, including "Host"

val get_header : ?f:( string -> string ) -> _ t -> string -> string option
val get_header_int : _ t -> string -> int option
val set_header : string -> string -> 'a t -> 'a t

set_header k v req sets k: v in the request req's headers.

val update_headers : ( Headers.t -> Headers.t ) -> 'a t -> 'a t

Modify headers

  • since 0.11
val set_body : 'a -> _ t -> 'a t

set_body b req returns a new query whose body is b.

  • since 0.11
val host : _ t -> string

Host field of the request. It also appears in the headers.

val meth : _ t -> Meth.t

Method for the request.

val path : _ t -> string

Request path.

val query : _ t -> (string * string) list

Decode the query part of the path field

  • since 0.4
val body : 'b t -> 'b

Request body, possibly empty.

val start_time : _ t -> float

time stamp (from Unix.gettimeofday) after parsing the first line of the request

  • since 0.11
val limit_body_size : max_size:int -> byte_stream t -> byte_stream t

Limit the body size to max_size bytes, or return a 413 error.

  • since 0.3
val read_body_full : ?buf_size:int -> byte_stream t -> string t

Read the whole body into a string. Potentially blocking.

  • parameter buf_size

    initial size of underlying buffer (since 0.11)

\ No newline at end of file +Request (tiny_httpd.Tiny_httpd_server.Request)

Module Tiny_httpd_server.Request

type 'body t = private {
meth : Meth.t;
host : string;
headers : Headers.t;
http_version : int * int;
path : string;
path_components : string list;
query : (string * string) list;
body : 'body;
start_time : float;(*

Obtained via get_time_s in create

  • since 0.11
*)
}

A request with method, path, host, headers, and a body, sent by a client.

The body is polymorphic because the request goes through several transformations. First it has no body, as only the request and headers are read; then it has a stream body; then the body might be entirely read as a string via read_body_full.

  • since 0.6 The field [query] was added and contains the query parameters in ["?foo=bar,x=y"]
  • since 0.6 The field [path_components] is the part of the path that precedes [query] and is split on ["/"].
  • since 0.11 the type is a private alias
  • since 0.11 the field [start_time] was added
val pp : Stdlib.Format.formatter -> string t -> unit

Pretty print the request and its body

val pp_ : Stdlib.Format.formatter -> _ t -> unit

Pretty print the request without its body

val headers : _ t -> Headers.t

List of headers of the request, including "Host"

val get_header : ?f:( string -> string ) -> _ t -> string -> string option
val get_header_int : _ t -> string -> int option
val set_header : string -> string -> 'a t -> 'a t

set_header k v req sets k: v in the request req's headers.

val update_headers : ( Headers.t -> Headers.t ) -> 'a t -> 'a t

Modify headers

  • since 0.11
val set_body : 'a -> _ t -> 'a t

set_body b req returns a new query whose body is b.

  • since 0.11
val host : _ t -> string

Host field of the request. It also appears in the headers.

val meth : _ t -> Meth.t

Method for the request.

val path : _ t -> string

Request path.

val query : _ t -> (string * string) list

Decode the query part of the path field

  • since 0.4
val body : 'b t -> 'b

Request body, possibly empty.

val start_time : _ t -> float

time stamp (from Unix.gettimeofday) after parsing the first line of the request

  • since 0.11
val limit_body_size : max_size:int -> byte_stream t -> byte_stream t

Limit the body size to max_size bytes, or return a 413 error.

  • since 0.3
val read_body_full : ?buf_size:int -> byte_stream t -> string t

Read the whole body into a string. Potentially blocking.

  • parameter buf_size

    initial size of underlying buffer (since 0.11)

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_server/Response/index.html b/dev/tiny_httpd/Tiny_httpd_server/Response/index.html index 5b129e45..c06348eb 100644 --- a/dev/tiny_httpd/Tiny_httpd_server/Response/index.html +++ b/dev/tiny_httpd/Tiny_httpd_server/Response/index.html @@ -1,5 +1,5 @@ -Response (tiny_httpd.Tiny_httpd_server.Response)

Module Tiny_httpd_server.Response

type body = [
| `String of string
| `Stream of byte_stream
| `Void
]

Body of a response, either as a simple string, or a stream of bytes, or nothing (for server-sent events).

type t = private {
code : Response_code.t;(*

HTTP response code. See Response_code.

*)
headers : Headers.t;(*

Headers of the reply. Some will be set by Tiny_httpd automatically.

*)
body : body;(*

Body of the response. Can be empty.

*)
}

A response to send back to a client.

val set_body : body -> t -> t

Set the body of the response.

  • since 0.11
val set_header : string -> string -> t -> t

Set a header.

  • since 0.11
val update_headers : ( Headers.t -> Headers.t ) -> t -> t

Modify headers

  • since 0.11
val set_headers : Headers.t -> t -> t

Set all headers.

  • since 0.11
val set_code : Response_code.t -> t -> t

Set the response code.

  • since 0.11
val make_raw : ?headers:Headers.t -> code:Response_code.t -> string -> t

Make a response from its raw components, with a string body. Use "" to not send a body at all.

val make_raw_stream : +Response (tiny_httpd.Tiny_httpd_server.Response)

Module Tiny_httpd_server.Response

type body = [
| `String of string
| `Stream of byte_stream
| `Void
]

Body of a response, either as a simple string, or a stream of bytes, or nothing (for server-sent events).

type t = private {
code : Response_code.t;(*

HTTP response code. See Response_code.

*)
headers : Headers.t;(*

Headers of the reply. Some will be set by Tiny_httpd automatically.

*)
body : body;(*

Body of the response. Can be empty.

*)
}

A response to send back to a client.

val set_body : body -> t -> t

Set the body of the response.

  • since 0.11
val set_header : string -> string -> t -> t

Set a header.

  • since 0.11
val update_headers : ( Headers.t -> Headers.t ) -> t -> t

Modify headers

  • since 0.11
val set_headers : Headers.t -> t -> t

Set all headers.

  • since 0.11
val set_code : Response_code.t -> t -> t

Set the response code.

  • since 0.11
val make_raw : ?headers:Headers.t -> code:Response_code.t -> string -> t

Make a response from its raw components, with a string body. Use "" to not send a body at all.

val make_raw_stream : ?headers:Headers.t -> code:Response_code.t -> byte_stream -> diff --git a/dev/tiny_httpd/Tiny_httpd_server/Response_code/index.html b/dev/tiny_httpd/Tiny_httpd_server/Response_code/index.html index 1221c1ee..fa0c8150 100644 --- a/dev/tiny_httpd/Tiny_httpd_server/Response_code/index.html +++ b/dev/tiny_httpd/Tiny_httpd_server/Response_code/index.html @@ -1,2 +1,2 @@ -Response_code (tiny_httpd.Tiny_httpd_server.Response_code)

Module Tiny_httpd_server.Response_code

type t = int

A standard HTTP code.

https://tools.ietf.org/html/rfc7231#section-6

val ok : t

The code 200

val not_found : t

The code 404

val descr : t -> string

A description of some of the error codes. NOTE: this is not complete (yet).

\ No newline at end of file +Response_code (tiny_httpd.Tiny_httpd_server.Response_code)

Module Tiny_httpd_server.Response_code

type t = int

A standard HTTP code.

https://tools.ietf.org/html/rfc7231#section-6

val ok : t

The code 200

val not_found : t

The code 404

val descr : t -> string

A description of some of the error codes. NOTE: this is not complete (yet).

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_server/Route/index.html b/dev/tiny_httpd/Tiny_httpd_server/Route/index.html index f366ec40..a9eece1a 100644 --- a/dev/tiny_httpd/Tiny_httpd_server/Route/index.html +++ b/dev/tiny_httpd/Tiny_httpd_server/Route/index.html @@ -1,2 +1,2 @@ -Route (tiny_httpd.Tiny_httpd_server.Route)

Module Tiny_httpd_server.Route

Routing

Basic type-safe routing.

  • since 0.6
type ('a, 'b) comp

An atomic component of a path

type ('a, 'b) t

A route, composed of path components

val int : ( int -> 'a, 'a ) comp

Matches an integer.

val string : ( string -> 'a, 'a ) comp

Matches a string not containing '/' and binds it as is.

val string_urlencoded : ( string -> 'a, 'a ) comp

Matches a URL-encoded string, and decodes it.

val exact : string -> ( 'a, 'a ) comp

exact "s" matches "s" and nothing else.

val return : ( 'a, 'a ) t

Matches the empty path.

val rest_of_path : ( string -> 'a, 'a ) t

Matches a string, even containing '/'. This will match the entirety of the remaining route.

  • since 0.7
val rest_of_path_urlencoded : ( string -> 'a, 'a ) t

Matches a string, even containing '/', an URL-decode it. This will match the entirety of the remaining route.

  • since 0.7
val (@/) : ( 'a, 'b ) comp -> ( 'b, 'c ) t -> ( 'a, 'c ) t

comp / route matches "foo/bar/…" iff comp matches "foo", and route matches "bar/…".

val exact_path : string -> ( 'a, 'b ) t -> ( 'a, 'b ) t

exact_path "foo/bar/..." r is equivalent to exact "foo" @/ exact "bar" @/ ... @/ r

  • since 0.11 *
val pp : Stdlib.Format.formatter -> ( _, _ ) t -> unit

Print the route.

  • since 0.7
val to_string : ( _, _ ) t -> string

Print the route.

  • since 0.7
\ No newline at end of file +Route (tiny_httpd.Tiny_httpd_server.Route)

Module Tiny_httpd_server.Route

Routing

Basic type-safe routing.

  • since 0.6
type ('a, 'b) comp

An atomic component of a path

type ('a, 'b) t

A route, composed of path components

val int : ( int -> 'a, 'a ) comp

Matches an integer.

val string : ( string -> 'a, 'a ) comp

Matches a string not containing '/' and binds it as is.

val string_urlencoded : ( string -> 'a, 'a ) comp

Matches a URL-encoded string, and decodes it.

val exact : string -> ( 'a, 'a ) comp

exact "s" matches "s" and nothing else.

val return : ( 'a, 'a ) t

Matches the empty path.

val rest_of_path : ( string -> 'a, 'a ) t

Matches a string, even containing '/'. This will match the entirety of the remaining route.

  • since 0.7
val rest_of_path_urlencoded : ( string -> 'a, 'a ) t

Matches a string, even containing '/', an URL-decode it. This will match the entirety of the remaining route.

  • since 0.7
val (@/) : ( 'a, 'b ) comp -> ( 'b, 'c ) t -> ( 'a, 'c ) t

comp / route matches "foo/bar/…" iff comp matches "foo", and route matches "bar/…".

val exact_path : string -> ( 'a, 'b ) t -> ( 'a, 'b ) t

exact_path "foo/bar/..." r is equivalent to exact "foo" @/ exact "bar" @/ ... @/ r

  • since 0.11 *
val pp : Stdlib.Format.formatter -> ( _, _ ) t -> unit

Print the route.

  • since 0.7
val to_string : ( _, _ ) t -> string

Print the route.

  • since 0.7
\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_server/index.html b/dev/tiny_httpd/Tiny_httpd_server/index.html index 943e8a28..05b86cee 100644 --- a/dev/tiny_httpd/Tiny_httpd_server/index.html +++ b/dev/tiny_httpd/Tiny_httpd_server/index.html @@ -1,5 +1,5 @@ -Tiny_httpd_server (tiny_httpd.Tiny_httpd_server)

Module Tiny_httpd_server

HTTP server.

This module implements a very simple, basic HTTP/1.1 server using blocking IOs and threads.

It is possible to use a thread pool, see create's argument new_thread.

  • since NEXT_RELEASE
type buf = Tiny_httpd_buf.t
type byte_stream = Tiny_httpd_stream.t

Methods

module Meth : sig ... end

Headers

Headers are metadata associated with a request or response.

module Headers : sig ... end

Requests

Requests are sent by a client, e.g. a web browser or cURL.

module Request : sig ... end

Response Codes

module Response_code : sig ... end

Responses

Responses are what a http server, such as Tiny_httpd, send back to the client to answer a Request.t

module Response : sig ... end
module Route : sig ... end
module Middleware : sig ... end

Main Server type

type t

A HTTP server. See create for more details.

val create : +Tiny_httpd_server (tiny_httpd.Tiny_httpd_server)

Module Tiny_httpd_server

HTTP server.

This module implements a very simple, basic HTTP/1.1 server using blocking IOs and threads.

It is possible to use a thread pool, see create's argument new_thread.

  • since NEXT_RELEASE
type buf = Tiny_httpd_buf.t
type byte_stream = Tiny_httpd_stream.t

Methods

module Meth : sig ... end

Headers

Headers are metadata associated with a request or response.

module Headers : sig ... end

Requests

Requests are sent by a client, e.g. a web browser or cURL.

module Request : sig ... end

Response Codes

module Response_code : sig ... end

Responses

Responses are what a http server, such as Tiny_httpd, send back to the client to answer a Request.t

module Response : sig ... end
module Route : sig ... end
module Middleware : sig ... end

Main Server type

type t

A HTTP server. See create for more details.

val create : ?masksigpipe:bool -> ?max_connections:int -> ?timeout:float -> diff --git a/dev/tiny_httpd/Tiny_httpd_server/module-type-SERVER_SENT_GENERATOR/index.html b/dev/tiny_httpd/Tiny_httpd_server/module-type-SERVER_SENT_GENERATOR/index.html index a602d7ff..ce9bcf65 100644 --- a/dev/tiny_httpd/Tiny_httpd_server/module-type-SERVER_SENT_GENERATOR/index.html +++ b/dev/tiny_httpd/Tiny_httpd_server/module-type-SERVER_SENT_GENERATOR/index.html @@ -1,5 +1,5 @@ -SERVER_SENT_GENERATOR (tiny_httpd.Tiny_httpd_server.SERVER_SENT_GENERATOR)

Module type Tiny_httpd_server.SERVER_SENT_GENERATOR

A server-side function to generate of Server-sent events.

See the w3c page and this blog post.

  • since 0.9
val set_headers : Headers.t -> unit

Set headers of the response. This is not mandatory but if used at all, it must be called before any call to send_event (once events are sent the response is already sent too).

val send_event : +SERVER_SENT_GENERATOR (tiny_httpd.Tiny_httpd_server.SERVER_SENT_GENERATOR)

Module type Tiny_httpd_server.SERVER_SENT_GENERATOR

A server-side function to generate of Server-sent events.

See the w3c page and this blog post.

  • since 0.9
val set_headers : Headers.t -> unit

Set headers of the response. This is not mandatory but if used at all, it must be called before any call to send_event (once events are sent the response is already sent too).

val send_event : ?event:string -> ?id:string -> ?retry:string -> diff --git a/dev/tiny_httpd/Tiny_httpd_stream/index.html b/dev/tiny_httpd/Tiny_httpd_stream/index.html index 016dcf30..1aae0fd4 100644 --- a/dev/tiny_httpd/Tiny_httpd_stream/index.html +++ b/dev/tiny_httpd/Tiny_httpd_stream/index.html @@ -1,5 +1,5 @@ -Tiny_httpd_stream (tiny_httpd.Tiny_httpd_stream)

Module Tiny_httpd_stream

Byte streams.

These used to live in Tiny_httpd but are now in their own module.

  • since 0.12
type hidden

Type used to make t unbuildable via a record literal. Use make instead.

type t = {
mutable bs : bytes;(*

The bytes

*)
mutable off : int;(*

Beginning of valid slice in bs

*)
mutable len : int;(*

Length of valid slice in bs. If len = 0 after a call to fill, then the stream is finished.

*)
fill_buf : unit -> unit;(*

See the current slice of the internal buffer as bytes, i, len, where the slice is bytes[i] .. [bytes[i+len-1]]. Can block to refill the buffer if there is currently no content. If len=0 then there is no more data.

*)
consume : int -> unit;(*

Consume n bytes from the buffer. This should only be called with n <= len.

*)
close : unit -> unit;(*

Close the stream.

*)
_rest : hidden;(*

Use make to build a stream.

*)
}

A buffered stream, with a view into the current buffer (or refill if empty), and a function to consume n bytes. See Byte_stream for more details.

val close : t -> unit

Close stream

val empty : t

Stream with 0 bytes inside

val of_chan : ?buf_size:int -> Stdlib.in_channel -> t

Make a buffered stream from the given channel.

val of_chan_close_noerr : ?buf_size:int -> Stdlib.in_channel -> t

Same as of_chan but the close method will never fail.

val of_bytes : ?i:int -> ?len:int -> bytes -> t

A stream that just returns the slice of bytes starting from i and of length len.

val of_string : string -> t
val iter : ( bytes -> int -> int -> unit ) -> t -> unit

Iterate on the chunks of the stream

  • since 0.3
val to_chan : Stdlib.out_channel -> t -> unit

Write the stream to the channel.

  • since 0.3
val make : +Tiny_httpd_stream (tiny_httpd.Tiny_httpd_stream)

Module Tiny_httpd_stream

Byte streams.

These used to live in Tiny_httpd but are now in their own module.

  • since 0.12
type hidden

Type used to make t unbuildable via a record literal. Use make instead.

type t = {
mutable bs : bytes;(*

The bytes

*)
mutable off : int;(*

Beginning of valid slice in bs

*)
mutable len : int;(*

Length of valid slice in bs. If len = 0 after a call to fill, then the stream is finished.

*)
fill_buf : unit -> unit;(*

See the current slice of the internal buffer as bytes, i, len, where the slice is bytes[i] .. [bytes[i+len-1]]. Can block to refill the buffer if there is currently no content. If len=0 then there is no more data.

*)
consume : int -> unit;(*

Consume n bytes from the buffer. This should only be called with n <= len.

*)
close : unit -> unit;(*

Close the stream.

*)
_rest : hidden;(*

Use make to build a stream.

*)
}

A buffered stream, with a view into the current buffer (or refill if empty), and a function to consume n bytes. See Byte_stream for more details.

val close : t -> unit

Close stream

val empty : t

Stream with 0 bytes inside

val of_chan : ?buf_size:int -> Stdlib.in_channel -> t

Make a buffered stream from the given channel.

val of_chan_close_noerr : ?buf_size:int -> Stdlib.in_channel -> t

Same as of_chan but the close method will never fail.

val of_bytes : ?i:int -> ?len:int -> bytes -> t

A stream that just returns the slice of bytes starting from i and of length len.

val of_string : string -> t
val iter : ( bytes -> int -> int -> unit ) -> t -> unit

Iterate on the chunks of the stream

  • since 0.3
val to_chan : Stdlib.out_channel -> t -> unit

Write the stream to the channel.

  • since 0.3
val make : ?bs:bytes -> ?close:( t -> unit ) -> consume:( t -> int -> unit ) -> diff --git a/dev/tiny_httpd/Tiny_httpd_util/index.html b/dev/tiny_httpd/Tiny_httpd_util/index.html index e7a5173d..974d3c02 100644 --- a/dev/tiny_httpd/Tiny_httpd_util/index.html +++ b/dev/tiny_httpd/Tiny_httpd_util/index.html @@ -1,2 +1,2 @@ -Tiny_httpd_util (tiny_httpd.Tiny_httpd_util)

Module Tiny_httpd_util

Some utils for writing web servers

  • since 0.2
val percent_encode : ?skip:( char -> bool ) -> string -> string

Encode the string into a valid path following https://tools.ietf.org/html/rfc3986#section-2.1

  • parameter skip

    if provided, allows to preserve some characters, e.g. '/' in a path.

val percent_decode : string -> string option

Inverse operation of percent_encode. Can fail since some strings are not valid percent encodings.

val split_query : string -> string * string

Split a path between the path and the query

  • since 0.5
val split_on_slash : string -> string list

Split a string on '/', remove the trailing '/' if any.

  • since 0.6
val get_non_query_path : string -> string

get the part of the path that is not the query parameters.

  • since 0.5
val get_query : string -> string

Obtain the query part of a path.

  • since 0.4
val parse_query : string -> ( (string * string) list, string ) Stdlib.result

Parse a query as a list of '&' or ';' separated key=value pairs. The order might not be preserved.

  • since 0.3
\ No newline at end of file +Tiny_httpd_util (tiny_httpd.Tiny_httpd_util)

Module Tiny_httpd_util

Some utils for writing web servers

  • since 0.2
val percent_encode : ?skip:( char -> bool ) -> string -> string

Encode the string into a valid path following https://tools.ietf.org/html/rfc3986#section-2.1

  • parameter skip

    if provided, allows to preserve some characters, e.g. '/' in a path.

val percent_decode : string -> string option

Inverse operation of percent_encode. Can fail since some strings are not valid percent encodings.

val split_query : string -> string * string

Split a path between the path and the query

  • since 0.5
val split_on_slash : string -> string list

Split a string on '/', remove the trailing '/' if any.

  • since 0.6
val get_non_query_path : string -> string

get the part of the path that is not the query parameters.

  • since 0.5
val get_query : string -> string

Obtain the query part of a path.

  • since 0.4
val parse_query : string -> ( (string * string) list, string ) Stdlib.result

Parse a query as a list of '&' or ';' separated key=value pairs. The order might not be preserved.

  • since 0.3
\ No newline at end of file diff --git a/dev/tiny_httpd/index.html b/dev/tiny_httpd/index.html index 28094494..6cb4eeb9 100644 --- a/dev/tiny_httpd/index.html +++ b/dev/tiny_httpd/index.html @@ -1,2 +1,2 @@ -index (tiny_httpd.index)

tiny_httpd index

Library tiny_httpd

This library exposes the following toplevel modules:

\ No newline at end of file +index (tiny_httpd.index)

tiny_httpd index

Library tiny_httpd

This library exposes the following toplevel modules:

\ No newline at end of file diff --git a/dev/tiny_httpd_camlzip/Tiny_httpd_camlzip/index.html b/dev/tiny_httpd_camlzip/Tiny_httpd_camlzip/index.html index 7c3668d1..b3a66ecb 100644 --- a/dev/tiny_httpd_camlzip/Tiny_httpd_camlzip/index.html +++ b/dev/tiny_httpd_camlzip/Tiny_httpd_camlzip/index.html @@ -1,5 +1,5 @@ -Tiny_httpd_camlzip (tiny_httpd_camlzip.Tiny_httpd_camlzip)

Module Tiny_httpd_camlzip

val middleware : +Tiny_httpd_camlzip (tiny_httpd_camlzip.Tiny_httpd_camlzip)

Module Tiny_httpd_camlzip

val middleware : ?compress_above:int -> ?buf_size:int -> unit -> diff --git a/dev/tiny_httpd_camlzip/index.html b/dev/tiny_httpd_camlzip/index.html index ced1a01e..7efe5809 100644 --- a/dev/tiny_httpd_camlzip/index.html +++ b/dev/tiny_httpd_camlzip/index.html @@ -1,2 +1,2 @@ -index (tiny_httpd_camlzip.index)

tiny_httpd_camlzip index

Library tiny_httpd_camlzip

The entry point of this library is the module: Tiny_httpd_camlzip.

\ No newline at end of file +index (tiny_httpd_camlzip.index)

tiny_httpd_camlzip index

Library tiny_httpd_camlzip

The entry point of this library is the module: Tiny_httpd_camlzip.

\ No newline at end of file