Struct reqwest::RedirectAttempt
source · pub struct RedirectAttempt<'a> { /* private fields */ }
Expand description
A type that holds information on the next request and previous requests in redirect chain.
Implementations§
source§impl<'a> RedirectAttempt<'a>
impl<'a> RedirectAttempt<'a>
sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
Get the type of redirect.
sourcepub fn previous(&self) -> &[Url]
pub fn previous(&self) -> &[Url]
Get the list of previous URLs that have already been requested in this chain.
sourcepub fn follow(self) -> RedirectAction
pub fn follow(self) -> RedirectAction
Returns an action meaning reqwest should follow the next URL.
sourcepub fn stop(self) -> RedirectAction
pub fn stop(self) -> RedirectAction
Returns an action meaning reqwest should not follow the next URL.
The 30x response will be returned as the Ok
result.
sourcepub fn loop_detected(self) -> RedirectAction
pub fn loop_detected(self) -> RedirectAction
Returns an action meaning there was a loop of redirects found.
An Error
will be returned for the result of the sent request.
sourcepub fn too_many_redirects(self) -> RedirectAction
pub fn too_many_redirects(self) -> RedirectAction
Returns an action meaning there was a loop of redirects found.
An Error
will be returned for the result of the sent request.