pub enum RedirectPolicy {
Follow {
max: usize,
},
Never,
}Expand description
What a client does with a redirect: follows it, up to a number, or answers the redirect response itself.
Variants§
Follow
Follow up to max redirects, then fail with HttpError::TooManyRedirects. Dart’s
HttpClient follows five by default.
A redirect that keeps the request’s method resends its body too (a 307 or a 308, and a
301 or a 302 of any method but POST, as fetch and RFC 9110 have it; a 303, and a 301 or a
302 of a POST, become a GET with no body): a client follows it when it holds the body, or
Body::try_clone answers Some for it; otherwise it answers the redirect response as
it is, rather than sending a request whose body is missing, and leaves the decision to
the app.
Never
Answer the first redirect response as it is, as Dart’s followRedirects = false does.
Implementations§
Source§impl RedirectPolicy
impl RedirectPolicy
Sourcepub const DEFAULT: RedirectPolicy
pub const DEFAULT: RedirectPolicy
Dart’s HttpClient: follow up to five redirects.
Trait Implementations§
Source§impl Clone for RedirectPolicy
impl Clone for RedirectPolicy
impl Copy for RedirectPolicy
Source§impl Debug for RedirectPolicy
impl Debug for RedirectPolicy
Source§impl Default for RedirectPolicy
impl Default for RedirectPolicy
Source§fn default() -> RedirectPolicy
fn default() -> RedirectPolicy
impl Eq for RedirectPolicy
Source§impl PartialEq for RedirectPolicy
impl PartialEq for RedirectPolicy
impl StructuralPartialEq for RedirectPolicy
Auto Trait Implementations§
impl Forget for RedirectPolicy
impl Freeze for RedirectPolicy
impl Move for RedirectPolicy
impl RefUnwindSafe for RedirectPolicy
impl Send for RedirectPolicy
impl Sync for RedirectPolicy
impl Unpin for RedirectPolicy
impl UnsafeUnpin for RedirectPolicy
impl UnwindSafe for RedirectPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.