Skip to content

Redirect

[Source]

A validated redirect hop, ready to follow.

The Location header has been resolved against the request URL, security rules applied (credentials stripped on a cross-origin hop, https-to-http downgrade refused before a Redirect is ever built), and the method and body rewritten for the response status. The remaining hop count is already decremented for the next hop.

RedirectFollower uses this internally — application code does not interact with it directly. The constructor is private so the security rules cannot be bypassed and the remaining hop count cannot be reset.

class val Redirect

Public Functions

status

[Source]

The redirect status code (301, 302, 303, 307, or 308).

fun box status()
: U16 val

Returns


target

[Source]

The resolved absolute URL to follow.

fun box target()
: URI val

Returns


request

[Source]

The request to send on the next hop: the original request with its method and body rewritten for the status and its headers stripped for a cross-origin hop.

fun box request()
: HTTPRequest val

Returns


remaining

[Source]

How many redirect hops may still be followed after this one.

fun box remaining()
: USize val

Returns