Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing wrap_stream method in wasm #2248

Open
irevoire opened this issue Apr 14, 2024 · 1 comment
Open

Missing wrap_stream method in wasm #2248

irevoire opened this issue Apr 14, 2024 · 1 comment

Comments

@irevoire
Copy link

Hello,

I was trying to make an API work both on x64 and wasm, reqwest seemed like the best library; it states:

The Client implementation automatically switches to the WASM one when the target_arch is wasm32, the usage is basically the same as the async api. Some of the features are disabled in wasm : tls, cookie, blocking.

But unfortunately, this sentence is false; when using the stream features, the wrap_stream method is not available.
Is this something forgotten during the implementation? Or is the documentation wrong and this feature can’t be implemented?

@ardouglas
Copy link

Not affiliated with reqwest in any way, but I came across this gap in the API last week as well. I took a swing at implementing it myself and it wasn't too hard but the support for streaming request bodies in browsers seems to be a mixed bag. I was able to get it working in chrome without issue but firefox seems to call toString on the request body when you pass it a stream. https://bugzilla.mozilla.org/show_bug.cgi?id=1387483

It's unclear to me whether this feature is implemented in safari or other browsers.

Despite this, if the reqwest team wants me to submit a PR for this I will.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants