package tiny_httpd

  1. Overview
  2. Docs

Module Tiny_httpd_utilSource

Some utils for writing web servers

  • since 0.2
Sourceval 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.

Sourceval percent_decode : string -> string option

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

Sourceval parse_query : string -> ((string * string) list, string) result

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

  • since 0.3