package yurt

  1. Overview
  2. Docs

Module Yurt_formSource

Sourceexception Invalid_multipart_form
Sourceval urlencoded : Cohttp_lwt.Body.t -> (string, string list) Hashtbl.t Lwt.t

Parse URL encoded form

Sourceval urlencoded_list : Cohttp_lwt.Body.t -> (string * string list) list Lwt.t
Sourceval urlencoded_json : Cohttp_lwt.Body.t -> Ezjsonm.t Lwt.t

Parse URL encoded form into JSON

There are a couple of big things from RFC2388 that aren't implemented yet: * 1. multipart/mixed content type may not be parsed correctly. * 2. content-transfer-encoding is currently ignored.

Sourcetype multipart = {
  1. mutable data : char Lwt_stream.t;
  2. mutable name : string;
  3. attr : (string, string list) Hashtbl.t;
}
Sourceval line_regexp : Str.regexp
Sourceval equal_regexp : Str.regexp
Sourceval semicolon_regexp : Str.regexp
Sourceval split_semicolon : string -> string list
Sourceval get_attr : multipart -> string -> string list
Sourceval is_file : multipart -> bool

Return true when the multipart object has a filename attribute

Sourceval is_multipart_regexp : Str.regexp
Sourceval is_multipart : Cohttp_lwt_unix.Request.t -> bool
Sourceval multipart : Cohttp_lwt_unix.Request.t -> Cohttp_lwt.Body.t -> multipart list Lwt.t
Sourcetype form =
  1. | Multipart of multipart list
  2. | Urlencoded of (string, string list) Hashtbl.t
Sourceval parse_form : Cohttp_lwt_unix.Request.t -> Cohttp_lwt.Body.t -> form Lwt.t

Parse URL encoded form

OCaml

Innovation. Community. Security.