Issue metadata
Sign in to add a comment
|
new Request().body returns undefined, against fetch spec
Reported by
michael....@gmail.com,
Dec 17
|
||||||||||||||||||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36
Steps to reproduce the problem:
1. Type the following in the developer console:
new Request('https://www.google.com', {method: 'POST', body: 'hi'}).body
2. Observe that the result is 'undefined'
What is the expected behavior?
Request is supposed to implement the Body mixin, so Requests with bodies should return a ReadableStream for the `body` property.
Relevant links:
https://fetch.spec.whatwg.org/#dom-body-body
https://developer.mozilla.org/en-US/docs/Web/API/Request
What went wrong?
The `body` property was undefined – among other things this makes it impossible to determine if a Request has a `body`, unless you use one of the other Body mixin methods which require actually reading the body and thus making the Request useless – unless you clone it beforehand.
Did this work before? N/A
Does this work in other browsers? No
Firefox exhibits the same behaviour: https://bugzilla.mozilla.org/show_bug.cgi?id=1514883
Chrome version: 70.0.3538.110 Channel: n/a
OS Version: OS X 10.14.2
Flash Version:
,
Dec 17
Request.body has not been implemented yet because of complications in uploads in the network stack. I believe this is a dupe of bug 688906.
,
Dec 17
Huh. I thought the fetch API was implemented in Chrome aaaaaaages ago. Thanks for looking into it!
,
Dec 17
Is there a workaround in the meantime to determine whether a Request has a body or not? |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by dtapu...@chromium.org
, Dec 17