You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to be able to read the body of a (multipart) request I have built, for tests, but I cannot because there does not seem to be a public API for converting a Body (async nor blocking) into bytes. It has an as_bytes() method, but for Inner::Streaming it returns None (same for blocking's Kind::Reader) so there seems to be no way to publicly access that data when it needs to be streamed to turn into bytes. Am I missing something to do this? Or is this a missing feature?
Am I missing something to do this? Or is this a missing feature?
You're not missing anything. It so far was not publicly exposed. In #2059, there's a possibility of keeping the public impl HttpBody for Body, in which case you could use that.
the unit tests access private methods.
The integration tests (in the tests directory) all use public methods, they are compiled as separate from the library, they don't have any internal access.
possibility of keeping the public impl HttpBody for Body,
Sounds good, I would appreciate that, thanks :)
The integration tests (in the tests directory) all use public methods, they are compiled as separate from the library, they don't have any internal access.
Yes, that's why I mentioned the unit tests as separate, e.g.
I want to be able to read the body of a (multipart) request I have built, for tests, but I cannot because there does not seem to be a public API for converting a
Body
(async nor blocking) into bytes. It has anas_bytes()
method, but forInner::Streaming
it returnsNone
(same for blocking'sKind::Reader
) so there seems to be no way to publicly access that data when it needs to be streamed to turn into bytes. Am I missing something to do this? Or is this a missing feature?To be clear, I see the tests: https://github.com/seanmonstar/reqwest/blob/master/tests/multipart.rs that compare against what was received by an actual http server. And the unit tests access private methods.
Thanks.
The text was updated successfully, but these errors were encountered: