RedirectPolicy enum
Policy that determines how FetchClient should handle redirects.
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
GETrequest.In this mode request is made with
RequestRedirect.manual, with no redirects, normal response is returned as usual.If redirect is occurred, additional
GETrequest will be sent and canceled before body will be available. Returning response with only headers and artificialLocationheader crafted fromResponse.url.Note that such response will always be crafted as
302 Foundand there's no way to get intermediate redirects, so you will get the targeted redirect as if the original server returned it. - probeHead → const RedirectPolicy
-
Same as probe but using
HEADmethod 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
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - 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.