reqwest icon indicating copy to clipboard operation
reqwest copied to clipboard

Expose Body::streaming as public API

Open Xuanwo opened this issue 1 year ago • 1 comments

Hi, http_body is reaching 1.0 now, maybe it's time for us to make Body::streaming public?

https://github.com/seanmonstar/reqwest/blob/0720159f6369f54e045a1fd315e0f24b7a0b4a39/src/async_impl/body.rs#L125-L142

This change will:

  • Close https://github.com/seanmonstar/reqwest/issues/1261
  • Allow users to pass non-continuous bytes as body without converting them into a stream.
  • Allow wasm users to pass iter/stream without collect them all (wasm client doesn't expose wrap_stream)

I'm willing to submit a PR if you feel this looks good.

Xuanwo avatar Apr 10 '24 03:04 Xuanwo

Would this make it possible to also easily add streaming in wasm per https://github.com/seanmonstar/reqwest/issues/2248 ?

rogusdev avatar Apr 16 '24 00:04 rogusdev