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

api.fetch - Add body option ReadableStream support data to fetch #16837

Closed
flaki opened this issue Jul 1, 2022 · 0 comments · Fixed by mdn/content#17849
Closed

api.fetch - Add body option ReadableStream support data to fetch #16837

flaki opened this issue Jul 1, 2022 · 0 comments · Fixed by mdn/content#17849
Labels
data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API

Comments

@flaki
Copy link

flaki commented Jul 1, 2022

What type of issue is this?

Missing compatibility data

What information was incorrect, unhelpful, or incomplete?

The documentation for the body option lists ReadableStream objects as a valid source of the body contents, but this seems to be unimplemented in most browsers today.

It would perhaps make sense to put a note in the body option description, and maybe even track the support for this feature in a compat table entry?

Edit: As the related issue #13854 mentions, the support (or lack thereof) is correctly tracked on the Request page compat tables, so I believe this can be just resolved through getting a note into the main fetch() page.

What browsers does this problem apply to, if applicable?

Chromium (Chrome, Edge 79+, Opera, Samsung Internet), Firefox

What did you expect to see?

That the documentation provides information whether ReadableStream objects can be used safely in browsers today to provide body content for fetch() requests.

Did you test this? If so, how?

(await fetch('https://httpbin.org/post', {
	method: 'POST',
	body: (await fetch('https://pokeapi.co/api/v2/pokemon/pikachu')).body
})).json()

Note that the posted data is the string "[object ReadableStream]", and not the JSON data returned from the embedded fetch.

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

Do you have anything more you want to share?

No response

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/fetch

MDN metadata

MDN page report details
  • Query: api.fetch
  • Report started: 2022-07-01T07:09:38.163Z
@queengooborg queengooborg added the data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants