RedirectHop

class RedirectHop(val url: Url, val status: Int)(source)

One followed redirect: the URL that was requested and the 3xx status it answered with. A chain [(A, 301), (B, 302)] with a response whose url is C means A answered 301, B answered 302 and C answered the response.

Stable Core. The constructor's shape is frozen. Equality is on url and status; toString() uses the redacted URL.

Parameters

url

the URL that was requested.

status

the redirect status it answered with, in 300..399.

Throws

if status is outside 300..399.

Constructors

Link copied to clipboard
constructor(url: Url, status: Int)

Properties

Link copied to clipboard
val status: Int

The redirect status it answered with, in 300..399.

Link copied to clipboard
val url: Url

The URL that was requested.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Two RedirectHops are equal when their url and status are equal.

Link copied to clipboard
open override fun hashCode(): Int

Returns a hash code consistent with equals: it is computed from the same properties.

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

A diagnostic string for logs: the url in its redacted form (Url.redacted) and status. Its format is not part of the API and may change.