I've always referenced the body property on an XMLHTTPRequest response because it's always a nice usable parsed js object. But this time body is null and the response is sitting there stringified in .text and I'd like to know why that might be, and the tradeoffs to using one over the other in server / client interactions.
I've always referenced the body property on an XMLHTTPRequest response because it's always a nice usable parsed js object. But this time body is null and the response is sitting there stringified in .text and I'd like to know why that might be, and the tradeoffs to using one over the other in server / client interactions.
Share Improve this question asked Feb 5, 2016 at 0:32 JamesJames 5,8274 gold badges26 silver badges28 bronze badges1 Answer
Reset to default 6Your server is responding with the wrong Content-Type
header. Ensure it is set to something reasonable like application/json
.