okhttp / okhttp3 / Request / Builder / url

url

open fun url(url: HttpUrl): Request.Builder open fun url(url: String): Request.Builder

Sets the URL target of this request.

Exceptions

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

open fun url(url: URL): Request.Builder

Sets the URL target of this request.

Exceptions

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