Enum tower_http::follow_redirect::policy::Action
source · pub enum Action {
Follow,
Stop,
}
Available on crate feature
follow-redirect
only.Expand description
A value returned by Policy::redirect
which indicates the action
FollowRedirect
should take for a redirection response.
Variants§
Follow
Follow the redirection.
Stop
Do not follow the redirection, and return the redirection response as-is.
Implementations§
Trait Implementations§
source§impl<B, E> Policy<B, E> for Action
impl<B, E> Policy<B, E> for Action
source§fn redirect(&mut self, _: &Attempt<'_>) -> Result<Action, E>
fn redirect(&mut self, _: &Attempt<'_>) -> Result<Action, E>
Invoked when the service received a response with a redirection status code (
3xx
). Read moresource§fn on_request(&mut self, _request: &mut Request<B>)
fn on_request(&mut self, _request: &mut Request<B>)
Invoked right before the service makes a request, regardless of whether it is redirected
or not. Read more