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

Mock request.body isn't a ReadableStream #135

Open
jamesarosen opened this issue Mar 11, 2020 · 3 comments
Open

Mock request.body isn't a ReadableStream #135

jamesarosen opened this issue Mar 11, 2020 · 3 comments

Comments

@jamesarosen
Copy link

jamesarosen commented Mar 11, 2020

MDN says of request.body

A simple getter used to expose a ReadableStream of the body contents.

In particular, I would expect const { value, done } = await request.body.getReader().read() to work.

See ReadableStream for more info.

@delphaber
Copy link

@jamesarosen have you found any alternative solution? :)

@jamesarosen
Copy link
Author

Since Request implements Body, try the Body API, e.g. await request.text().

@delphaber
Copy link

hi @jamesarosen thanks for the reply :) Unfortunately my production code needs a readable stream :(

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