Url

class Url

Represents a full, valid URL

Parameters

scheme

The wire protocol (e.g., http, https, etc.)

host

The Host for the URL

port

The remote port number for the URL (e.g., TCP port)

path

The path element of this URL

parameters

The query parameters for this URL.

fragment

Optional fragment component of this URL (without the # character)

userInfo

Optional user authentication information for this URL

Types

Link copied to clipboard

A mutable builder used to construct Url instances

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
val host: Host
Link copied to clipboard

Gets the host and port for the URL. The port is omitted if it's the default for the scheme.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val port: Int
Link copied to clipboard

Gets a request-relative path string for this URL which is suitable for use in an HTTP request line. The given path will include query parameters and the fragment and will be prepended with a / (even for empty paths without a trailing slash configured). It will not include the protocol, host, port, or user info.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun copy(block: Url.Builder.() -> Unit = { }): Url

Returns a copy of this URL with the given DSL builder block applied to modify any desired fields. The returned instance is disconnected from this instance.

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

Copy the properties of this Url instance into a new Builder object. Any changes to the builder will not affect this instance.

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

Returns the encoded string representation of this URL