CORS xmlhttprequest HEAD方法 [英] CORS xmlhttprequest HEAD method

查看:368
本文介绍了CORS xmlhttprequest HEAD方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用带有CORS对象的HEAD方法请求标头数据时,它返回null。



getAllResponseHeaders() - > return null。



如何在其他网站中设置php头,以便我可以检索头数据>



ps:这不在同一个域中。

解决方案

我是一个跨源资源共享



<我注意到这种行为在Firefox(3.6.13); getAllResponseHeaders()不返回任何内容。在Chrome / Safari中,getAllResponseHeaders()只返回简单的响应标头(如规范中所定义) http:/ /www.w3.org/TR/cors/#terminology )。这些浏览器都不遵守Access-Control-Expose-Headers头。


When requesting header data using HEAD method with CORS object, it returns null.

getAllResponseHeaders() -> return null.

How to setup php headers in the other site so that I can retrieve header data>

p.s.: this is not within the same domain. it's a cross origin resource sharing

Thank you

解决方案

I've noticed this behavior in Firefox (3.6.13); getAllResponseHeaders() returns nothing. In Chrome/Safari, getAllResponseHeaders() only returns simple response headers (as defined in the spec http://www.w3.org/TR/cors/#terminology). None of these browsers respect the Access-Control-Expose-Headers header.

这篇关于CORS xmlhttprequest HEAD方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆