How to convert the body from axum request into "reqwest" body? #2603
Unanswered
spikeHollow
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Basically what https://github.com/tokio-rs/axum/blob/main/examples/reqwest-response/src/main.rs does |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
I'm trying to convert the body received from axum Request as body to reqwest client. But, when I do req.body(), it gives just &Body which doesn't give any info about type of Body.
I'm doing this inside a closure for tower::service_fn. It only works if the closure argument is axum Request. I'm stuck at this point. Any kind of help would be really appreciated.
Ideally, I want the body to be directly streamed from request to the reqwest client, but this needs the ownership of the body.
axum version
0.7.4
Beta Was this translation helpful? Give feedback.
All reactions