问题描述
当我在我们的生产系统上执行 XHR 时,响应中的 statusText 将是一个空字符串.但是,在我们的开发系统中,statusText 会正确反映状态.
When I perform an XHR on our production system, the statusText in the response will be an empty string. However, on our development system, the statusText will reflect the status correctly.
根据 XMLHttpRequest.statusText<的文档/code>,它只能在处理请求时为空.但是,我在 onload 处理程序中看到了这种行为.
According to the documentation for XMLHttpRequest.statusText, it should only be empty while the request is being processed. However, I am seeing this behavior in the onload handler.
此外,这种行为只能在 Chrome 和 Edge 中观察到.Firefox 将显示正确的文本.
Additionally, this behavior can only be observed in Chrome and Edge. Firefox will display the correct text.
那么,statusText的内容究竟是如何确定的呢?
So, how is the content of the statusText actually determined?
推荐答案
可能是因为一台服务器使用 HTTP/2,而另一台没有.HTTP/2 不再有原因短语.
It might be because one server uses HTTP/2, while the other does not. HTTP/2 doesn't have reason phrases anymore.
这篇关于为什么我的 XHR 的 statusText 是空的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)