How to read bytes from body #288
-
how can i access the bytes? |
Beta Was this translation helpful? Give feedback.
Answered by
davidpdrsn
Aug 29, 2021
Replies: 2 comments
-
You have a few options:
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
davidpdrsn
-
Axum 0.7 provides |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You have a few options:
Bytes
as an extractor which buffers the request body. It also provides other utilities. SeeFromRequest
for everything that can be used as extractors.to_bytes
andaggregate
that let you buffer the body into aBytes
.axum::body::Body
is a re-export ofhyper::Body
, which implementshttp_body::Body
. That gives low level access to the byte stream.