A URI. Can represent both relative and absolute URIs, hence in terms of https://tools.ietf.org/html/rfc3986, this is a URI reference.
A URI. Can represent both relative and absolute URIs, hence in terms of https://tools.ietf.org/html/rfc3986, this is a URI reference.
All components (scheme, host, query, ...) are stored decoded, and become encoded upon serialization (using toString).
Instances can be created using the uri interpolator: uri"..."
(see UriInterpolator), or the factory methods
on the Uri companion object.
The apply
/safeApply
/unsafeApply
methods create absolute URIs and require a host.
The relative
methods creates a relative URI, given path/query/fragment components.
- Value Params
- querySegments
Either key-value pairs, single values, or plain query segments. Key value pairs will be serialized as
k=v
, and blocks of key-value pairs/single values will be combined using&
. Note that no&
or other separators are added around plain query segments - if required, they need to be added manually as part of the plain query segment. Custom encoding logic can be provided when creating a segment.
- Companion
- object
Value members
Concrete methods
Replace the host. Does not validate the new host value if it's nonempty.
Replace the host. Does not validate the new host value if it's nonempty.
Replace the host. Does not validate the new host value if it's nonempty.
Replace the host. Does not validate the new host value if it's nonempty.
Replace the host. Does not validate the new host value if it's nonempty.
Replace the host. Does not validate the new host value if it's nonempty.
Replace the port. Adds an empty host if one is absent.
Replace the port. Adds an empty host if one is absent.
Replace the port. Adds an empty host if one is absent, and port is defined.
Replace the port. Adds an empty host if one is absent, and port is defined.
Replace encoding for query segments: applies to key-value, only-value and plain ones.
Replace encoding for query segments: applies to key-value, only-value and plain ones.
Replace encoding for the value part of key-value query segments and for only-value ones.
Replace encoding for the value part of key-value query segments and for only-value ones.
Replace the scheme. Does not validate the new scheme value.
Replace the scheme. Does not validate the new scheme value.
Replace the scheme. Does not validate the new scheme value.
Replace the scheme. Does not validate the new scheme value.
Replace the user info with a username only. Adds an empty host if one is absent.
Replace the user info with a username only. Adds an empty host if one is absent.
Replace the user info with username/password combination. Adds an empty host if one is absent.
Replace the user info with username/password combination. Adds an empty host if one is absent.
Replace the user info with username/password combination. Adds an empty host if one is absent, and user info is defined.
Replace the user info with username/password combination. Adds an empty host if one is absent, and user info is defined.
Replace query with the given single optional parameter.
Replace query with the given single optional parameter.
Deprecated methods
Adds the given parameter to the query.
Adds the given parameter to the query.
- Deprecated
[Since version 1.2.0]
Use addParam or withParam
Adds the given parameter with an optional value to the query if it is present.
Adds the given parameter with an optional value to the query if it is present.
- Deprecated
[Since version 1.2.0]
Use addParam or withParam
Adds the given parameters to the query.
Adds the given parameters to the query.
- Deprecated
[Since version 1.2.0]
Use addParam or withParam
Adds the given parameters to the query.
Adds the given parameters to the query.
- Deprecated
[Since version 1.2.0]
Use addParam or withParam
Adds the given parameters to the query.
Adds the given parameters to the query.
- Deprecated
[Since version 1.2.0]
Use addParam or withParam
Replace path with the given single-segment path.
Replace path with the given single-segment path.
- Deprecated
[Since version 1.2.0]
Use addPath, withPath or withWholePath
Replace path with the given path segments.
Replace path with the given path segments.
- Deprecated
[Since version 1.2.0]
Use addPath, withPath or withWholePath
Replace path with the given path segments.
Replace path with the given path segments.
- Deprecated
[Since version 1.2.0]
Use addPath, withPath or withWholePath
Replace path with the given path segment.
Replace path with the given path segment.
- Deprecated
[Since version 1.2.0]
Use addPath, withPath or withWholePath
Replace path with the given path segment.
Replace path with the given path segment.
- Deprecated
[Since version 1.2.0]
Use addPath, withPath or withWholePath
Replace path with the given path segments.
Replace path with the given path segments.
- Deprecated
[Since version 1.2.0]
Use addPath, withPath or withWholePath