/uritemplate-ocaml

OCaml implementation of URI templates (RFC6570 - https://tools.ietf.org/html/rfc6570)

Primary LanguageOCamlMIT LicenseMIT

uritemplate-ocaml

Work in progress implementation of URI templates for OCaml. (RFC6570 - http://tools.ietf.org/html/rfc6570)

Compliant to level 4

ODoc documentation avaliable here.

Install via opam

Easiest way to install is via opam:

$ opam install uritemplate

Usage

# #require "uritemplate";;

# Uritemplate.template_uri
    ~template:"https://example.com{/a}{?b*}{#e,f}"
    ~variables:[("a", `String "a");
                ("b", `Assoc [("b", "b"); ("c", "c")]);
                ("e", `String "e");
                ("f", `List ["f"; "g"])];;
- : string = "https://example.com/a?b=b&c=c#e,f,g"