You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
MDN documentation of Request states:
Though at MDN documentation for
Request()
ReadableStream
is not listed as valid option.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 offetch()
reading fromReadableStream
to populate thebody
of aPOST
request?Edit: Related #378
The text was updated successfully, but these errors were encountered: