Url

class Url

Represents an immutable URL

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
val encodedFragment: String
Link copied to clipboard
val encodedPassword: String?
Link copied to clipboard
val encodedPath: String

encoded path without query string

Link copied to clipboard
val encodedPathAndQuery: String
Link copied to clipboard
val encodedQuery: String
Link copied to clipboard
val encodedUser: 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 pathSegments: List<String>
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
fun Url.copy(protocol: URLProtocol = this.protocol, host: String = this.host, specifiedPort: Int = this.specifiedPort, encodedPath: String = this.encodedPath, parameters: Parameters = this.parameters, fragment: String = this.fragment, user: String? = this.user, password: String? = this.password, trailingQuery: Boolean = this.trailingQuery): Url
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
val Url.protocolWithAuthority: String

A Url protocol and authority.

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

Convert Url to URI