Module follow_redirect
Middleware for following redirections.
Overview
The FollowRedirect middleware retries requests with the inner Service to follow HTTP
redirections.
The middleware tries to clone the original Request when making a redirected request.
However, since [Extensions][http::Extensions] are !Clone, any extensions set by outer
middleware will be discarded. Also, the request body cannot always be cloned. When the
original body is known to be empty by Body::size_hint, the middleware uses Default
implementation of the body type to create a new request body. If you know that the body can be
cloned in some way, you can tell the middleware to clone it by configuring a policy.
Examples
Basic usage
use ;
use Bytes;
use Full;
use ;
use ;
#
# async
Customizing the Policy
You can use a Policy value to customize how the middleware handles redirections.
use ;
use Full;
use Bytes;
use ;
use ;
#
# async
Modules
-
policy
Tools for customizing the behavior of a [
FollowRedirect][super::FollowRedirect] middleware.
Structs
-
FollowRedirect
Middleware that retries requests with a
Serviceto follow redirection responses. -
FollowRedirectLayer
Layerfor retrying requests with aServiceto follow redirection responses. -
RequestUri
Response [
Extensions][http::Extensions] value that represents the effective request URI of a response returned by aFollowRedirectmiddleware. -
ResponseFuture
Response future for
FollowRedirect.