HttpUrl

Methods
20
Fields
1

Getting one

HttpUrl.get(…)
HttpUrl.parse(…)
HttpUrlBuilder.new():build()

Methods

MethodReturnsDescription
newBuilder()HttpUrlBuilderA builder holding this URL.
scheme()stringhttp or https.
isHttps()booleanWhether it is https.
host()stringThe host: lowercase, IDN in ASCII, an IP literal canonical.
port()numberThe port (the scheme's default when the URL names none).
username()stringThe decoded user name.
password()stringThe decoded password.
encodedPath()stringThe path, encoded (/a%20b/c).
pathSegments(){string}The path segments, decoded.
encodedPathSegments(){string}The path segments, encoded.
encodedQuery()string?The query, encoded, or nil without one.
query()string?The query, decoded, or nil.
queryParameter(string)string?The first value of query parameter name, decoded, or nil.
queryParameterValues(string){ n: number, [number]: string? }Every value of name, decoded (nil for one without =).
querySize()numberHow many query parameters.
fragment()string?The fragment, decoded, or nil.
equals(any)booleanWhether other is the same URL.
toString()stringThe URL, as OkHttp writes it.
get(string)HttpUrlThe URL url names; anything but an http/https URL is IllegalArgumentException.
parse(string)HttpUrl?The URL url names, or nil.

Fields

FieldTypeDescription
BuilderHttpUrlBuilderClassHttpUrl.Builder: the nested class HttpUrlBuilder.

Returned by

MethodReturnsDescription
HttpUrlBuilder.buildHttpUrlThe URL; without a scheme or host it is IllegalStateException.
HttpUrlClass.getHttpUrlThe URL url names; anything but an http/https URL is IllegalArgumentException.
HttpUrlClass.parseHttpUrl?The URL url names, or nil.
Request.urlHttpUrlThe URL.

Method details

host

host: (HttpUrl) -> string

The host: lowercase, IDN in ASCII, an IP literal canonical.

port

port: (HttpUrl) -> number

The port (the scheme's default when the URL names none).

queryParameter

queryParameter: (HttpUrl, string) -> string?

The first value of query parameter name, decoded, or nil.

queryParameterValues

queryParameterValues: (HttpUrl, string) -> { n: number, [number]: string? }

Every value of name, decoded (nil for one without =).

equals

equals: (HttpUrl, any) -> boolean

Whether other is the same URL.

get

get: (string) -> HttpUrl

The URL url names; anything but an http/https URL is IllegalArgumentException.