-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Consider a request to a server that successfully returns XML data (aka anything that is not JSON).
In the node version we have this flow:
- construct
outas the concatenated data stream string - since the header
content-typedoes not includeapplication/jsonso... - the response
dataproperty is set to theout(aka the response body realized) - the promise is resolved with that response (aka
response.datais the response body XML string)
However, in the fetch version we have this flow:
- the header
content-typedoes not includeapplication/jsonso... - try to parse the string from
fetch.text()as JSON - since the response is XML this throws
- set the error on the response
- the promise is rejected but the
fetch.text()string is not available on the response
Metadata
Metadata
Assignees
Labels
No labels