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

Setting body as ReadableStream at POST request #439

Closed
guest271314 opened this issue Dec 18, 2016 · 1 comment
Closed

Setting body as ReadableStream at POST request #439

guest271314 opened this issue Dec 18, 2016 · 1 comment

Comments

@guest271314
Copy link

guest271314 commented Dec 18, 2016

MDN documentation of Request states:

Note: The body type only can be a Blob, BufferSource, FormData, URLSearchParams, USVString or ReadableStream type, so for adding a JSON object to the payload it need to be stringify that object.

Though at MDN documentation for Request() ReadableStream is not listed as valid option.

body: Any body that you want to add to your request: this can be a Blob, BufferSource, FormData, URLSearchParams, or USVString object. Note that a request using the GET or HEAD method cannot have a body.

Could not find an example of the same at the specification. After searching before posting the question here or at stackoverflow, found that the question had already recently been asked Fetch with ReadableStream.

Tried a slightly different pattern than the javascript at Question at SO, though result was essentially the same. Is this possible? Is MDN documentation incorrect? If possible, what is the correct pattern to achieve the expected result of fetch() reading from ReadableStream to populate the body of a POST request?

Edit: Related #378

@guest271314 guest271314 changed the title Passing ReadableStream as Request.body to fetch Passing ReadableStream at Request() body to fetch Dec 18, 2016
@guest271314 guest271314 changed the title Passing ReadableStream at Request() body to fetch Setting body as ReadableStream Dec 18, 2016
@guest271314 guest271314 changed the title Setting body as ReadableStream Setting body as ReadableStream at POST request Dec 18, 2016
@annevk
Copy link
Member

annevk commented Dec 19, 2016

This is a duplicate of #88 that is being fixed by #425. This is new functionality that's not yet ready, but will be soon.

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

No branches or pull requests

2 participants