Is it possible to disable redirect following just for one call? #2310
-
Is there a way to tell reqwest to avoid redirect just for this one call instead of creating a single Client just for this call? What I'm using right now is: let http_client = reqwest::ClientBuilder::new()
.redirect(reqwest::redirect::Policy::none())
.build()?;
let req = reqwest::Request::try_from(something()).unwrap();
let res = http_client.execute(req).await.unwrap(); As you can see I'm creating a new client for this call. I would like to use the "global" client in this way: let res = http_client.redirect(reqwest::redirect::Policy::none()).execute(req).await.unwrap(); Is it possible? I know I can use the custom method but I'm wondering this other way. |
Beta Was this translation helpful? Give feedback.
Answered by
seanmonstar
Jun 5, 2024
Replies: 1 comment
-
It is not currently possible. See #353 for a feature request. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
frederikhors
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is not currently possible. See #353 for a feature request.