URI #
This module defines the URI and RequestTarget types that represent and manipulate components of
URIs as defined by RFC 3986. It provides parsing, rendering, and normalization utilities for working
with URIs and request targets in HTTP messages.
References:
Attempts to parse a RequestTarget from the given string.
Equations
- Std.Http.RequestTarget.parse? string = ((Std.Http.URI.Parser.parseRequestTarget <* Std.Internal.Parsec.eof).run string.toUTF8).toOption
Instances For
Parses a RequestTarget from the given string. Panics if parsing fails. Use parse?
if you need a safe option-returning version.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Creates an origin-form request target from a path string. The path should start with '/' (e.g., "/api/users" or "/search?q=test"). Panics if the string is not a valid origin-form request target.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Attempts to parse a URI from the given string.
Equations
- Std.Http.URI.parse? string = ((Std.Http.URI.Parser.parseURI <* Std.Internal.Parsec.eof).run string.toUTF8).toOption
Instances For
Parses a URI from the given string. Panics if parsing fails. Use parse? if you need a safe
option-returning version.
Equations
- Std.Http.URI.parse! string = match Std.Http.URI.parse? string with | some res => res | none => panicWithPosWithDecl "Std.Internal.Http.Data.URI" "Std.Http.URI.parse!" 77 12 "invalid URI"
Instances For
Attempts to parse a URI path from the given string.
Returns none if the string is not a valid path.
Equations
Instances For
Parses a URI path from the given string. Returns the root path "/" if parsing fails.
Equations
- Std.Http.URI.Path.parseOrRoot s = (Std.Http.URI.Path.parse? s).getD { segments := #[], absolute := true }