Builder

A mutable builder used to construct Url instances

Constructors

Link copied to clipboard
constructor()

Initialize an empty Url builder

Properties

Link copied to clipboard

Get or set the fragment as a decoded string

Link copied to clipboard

Get or set the fragment as an encoded string

Link copied to clipboard
var host: Host

The Host for the URL

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

Gets the query parameters builder

Link copied to clipboard

Gets the URL path builder

Link copied to clipboard
var port: Int?

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

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

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

Link copied to clipboard

Get the user info builder

Functions

Link copied to clipboard
fun build(): Url

Build a new Url from the currently-configured builder values

Link copied to clipboard
fun copyFrom(url: Url)

Copies state from url into this builder. All existing state is overwritten.

Link copied to clipboard
open override fun deepCopy(): Url.Builder

Returns a deep copy of this object.

Link copied to clipboard
inline fun parameters(block: QueryParameters.Builder.() -> Unit)

Update the QueryParameters of this URL via a DSL builder block

Link copied to clipboard
inline fun path(block: UrlPath.Builder.() -> Unit)

Update the UrlPath of this URL via a DSL builder block

Link copied to clipboard
inline fun userInfo(block: UserInfo.Builder.() -> Unit)

Set the user info in this URL via a DSL builder block