Closed jmtame closed 7 years ago
@jmtame Thanks for reaching out!
I see you're checking for when the response is a string and otherwise treating as already parsed. I'm assuming that in browsers like Chrome/Firefox the response is returned already parsed and in IE11 it's returned as a string. Is that correct?
I imagine it's likely a configuration of the request and the defaults are different in each browser. I'm assuming the request
you're using is this one?
It looks like there might be a way to specify the response type explicitly: https://xhr.spec.whatwg.org/#the-responsetype-attribute
I run into a similar issue regularly when I'm using the request library in Node. If you know you're expecting JSON, you can add an option {json: true}
and it will provide the response already parsed. Otherwise, the response is provided as a string and you can parse it yourself.
Hope this helps!
Hi @rkstedman - thanks for the reply. I tried setting the responseType
to json
but that didn't work. Looks like an issue that Microsoft is aware of, but not fixing at the moment.
The response comes back as a string in IE11 and needs to be parsed. This fixed it for me: