Uri
2 types5 functionsThe URI pieces Http needs: query strings, percent-encoding and path
segments. Query parameters are name/value
records, since Bert has no tuples.
Types
QueryParam
One name=value pair of a query string, both percent-decoded.
Result
Shorthand for [Ok(a) | Err(e)], the variant this module's fallible
functions return.
Functions
parseQuery
The &-separated name=value pairs of a query, each side percent-decoded
with + read as a space. A pair with no = has the empty value; an empty
query, or an empty piece between two &, holds no pair. Any encoding that
does not decode to UTF-8 is an Err, and so are raw bytes that are not
UTF-8.
queryToString
The pairs as a query, each side percent-encoded, with + encoded too so
that parseQuery does not read it back as a space.
percentEncode
Each UTF-8 byte outside the unreserved set as %XX, in uppercase hex. ASCII
letters, digits and ! $ ' ( ) * + - . _ ~ are kept as they are.
percentDecode
Each %XX as the byte it encodes, and + kept as it is. The bytes must
form UTF-8, and a % not followed by two hex digits is an Err too.
pathSegments
The non-empty segments of a path, with each . dropped and each ..
dropping the segment before it, as RFC 3986 resolves dot-segments. A ..
with nothing before it is dropped.