最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - XMLHTTPRequest responseBody vs responseText - Stack Overflow

programmeradmin2浏览0评论

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 badges
Add a ment  | 

1 Answer 1

Reset to default 6

Your server is responding with the wrong Content-Type header. Ensure it is set to something reasonable like application/json.

发布评论

评论列表(0)

  1. 暂无评论