Skip to content

//okhttp/okhttp3/Request/Builder/url

url

[jvm, nonJvm]\ [jvm]\ open fun url(url: HttpUrl): Request.Builder

[jvm, nonJvm]\ actual open fun url(url: String): Request.Builder

[jvm]\ open fun url(url: URL): Request.Builder

Sets the URL target of this request.

Throws

kotlin.IllegalArgumentException if the scheme of url is not http or https.

[common]\ expect open fun url(url: String): Request.Builder

Sets the URL target of this request.

Throws

kotlin.IllegalArgumentException if url is not a valid HTTP or HTTPS URL. Avoid this exception by calling HttpUrl.parse; it returns null for invalid URLs.