Route

class Route(pathQueryAndFragment: String)(source)

A path component to a relative or absolute URL string without a domain, e.g. "/example/path" or "example/path".

If this route is constructed with a leading domain, e.g. "http://whatever.com" or protocol, e.g. "mailto:account@site.com", it will throw an exception

Constructors

Link copied to clipboard
constructor(path: String, queryParams: Map<String, String>, fragment: String?)

Create a route using piecemeal components instead of passing in a giant URL string.

constructor(pathQueryAndFragment: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The fragment of the original URL (decoded, in case originally URL encoded)

Link copied to clipboard

The path part of the original URL (i.e. the part without query parameters or a fragment)

Link copied to clipboard

The query parameters of the original URL (decoded, in case originally URL encoded)

Link copied to clipboard

Functions

Link copied to clipboard
fun copy(path: String = this.path, queryParams: Map<String, String> = this.queryParams, fragment: String? = this.fragment): Route

Make a copy of this Route, optionally changing one or more of its components.

Link copied to clipboard
open override fun toString(): String