package brr

  1. Overview
  2. Docs
Browser programming toolkit for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

brr-0.0.7.tbz
sha512=4b3d42eb6a32c1d6f1c5ef003f5311b5029156b31f6e51af098b695c769699e0304b66afd2dd574ecf1084e095bbbc4eac552daab083766cd81ed2f1d9897d51

doc/brr/Brr/Uri/Params/index.html

Module Uri.Params

URI fragment or query parameters.

Params.t values represent key-value parameters stored in strings as "k0=v0&k1=v1...". They can be constructed from any Jstr.t. In particular it means they can be used with an URI fragment or query.

Parameters

type t

The type for URLSearchParams objects.

val is_empty : t -> bool

is_empty ps is true if ps has no key value bindings.

val mem : Jstr.t -> t -> bool

mem k ps is true if key k is bound in ps.

val find : Jstr.t -> t -> Jstr.t option

find k ps is the value of the first binding of k in ps.

val find_all : Jstr.t -> t -> Jstr.t list

find_all k ps are the values of all bindings of k in ps.

val fold : (Jstr.t -> Jstr.t -> 'a -> 'a) -> t -> 'a -> 'a

fold f ps acc folds all the key value bindings.

Converting

val of_obj : Jv.t -> t

of_obj o uses the keys of object o to define URL parameters.

val of_jstr : Jstr.t -> t

of_jstr s URL decodes and parses parameters from s.

val to_jstr : t -> Jstr.t

to_jstr ps URL encodes the parameters ps to a string.

val of_assoc : (Jstr.t * Jstr.t) list -> t

of_assoc assoc are parameters for the assoc assoc.

val to_assoc : t -> (Jstr.t * Jstr.t) list

to_assoc ps is ps as an assoc list.

OCaml

Innovation. Community. Security.