RedirectPolicy enum

How FetchClient should handle redirects.

Inheritance

Constructors

RedirectPolicy()
const

Values

alwaysFollow → const RedirectPolicy

Default policy - always follow redirects. If redirect is occurred the only way to know about it is via FetchResponse.redirected and FetchResponse.url.

probe → const RedirectPolicy

Probe via HTTP GET request.

Is this mode request is made with RequestRedirect.manual, with no redirects, normal response is returned as usual.

If redirect is occurred additional GET request will be send and canceled before body will be available. Returning response with only headers and artificial Location header crafted from Response.url.

Note that such response will always be crafted as 302 Found and there's no way to get intermediate redirects, so you will get target redirect as if the original server returned it.

probeHead → const RedirectPolicy

Same as probe but using HEAD method and therefore no cancel is needed.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<RedirectPolicy>
A constant List of the values in this enum, in order of their declaration.