Url

data class Url(protocol: URLProtocol, host: String, specifiedPort: Int, encodedPath: String, parameters: Parameters, fragment: String, user: String?, password: String?, trailingQuery: Boolean)

Represents an immutable URL

Constructors

Link copied to clipboard
fun Url(protocol: URLProtocol, host: String, specifiedPort: Int, encodedPath: String, parameters: Parameters, fragment: String, user: String?, password: String?, trailingQuery: Boolean)

Types

Link copied to clipboard
object Companion

Functions

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

Properties

Link copied to clipboard
val encodedPath: String

encoded path without query string

Link copied to clipboard
val fragment: String

URL fragment (anchor name)

Link copied to clipboard
val host: String

name without port (domain)

Link copied to clipboard
val parameters: Parameters

URL query parameters

Link copied to clipboard
val password: String?

password part of URL

Link copied to clipboard
val port: Int

the specified port or protocol default port

Link copied to clipboard
val protocol: URLProtocol
Link copied to clipboard
val specifiedPort: Int

port number that was specified to override protocol's default

Link copied to clipboard
val trailingQuery: Boolean

keep trailing question character even if there are no query parameters

Link copied to clipboard
val user: String?

username part of URL

Extensions

Link copied to clipboard
val Url.authority: String

Url authority.

Link copied to clipboard
val Url.fullPath: String

Full encoded path with query string but without domain, port and schema

Link copied to clipboard
val Url.hostWithPort: String

Host:port pair, not normalized so port is always specified even if the port is schema's default

Link copied to clipboard
fun Url.toURI(): URI

Convert Url to URI