【发布时间】:2017-10-14 06:54:56
【问题描述】:
我在发布对象时遇到问题,作为响应,我应该从 HTTP 响应中获取一些标头。问题是这段代码在 Chrome、Firefox、IE 等浏览器中运行良好,但在 Safari (Windows) 的情况下它返回 null。
$http.post(url, data)
.then(function(response){
console.log(response.headers("location"));
// response.headers("location") is null in Safari
});
以下是我从服务器获取的响应标头。
Access-Control-Allow-Credentials:true
Access-Control-Allow-Origin:http://localhost:5000
Access-Control-Expose-Headers:ETag,Location
Content-Length:0
Date:Mon, 15 May 2017 12:46:14 GMT
Location: //my API
Server:Microsoft-IIS/8.5
X-Powered-By:ASP.NET
【问题讨论】:
标签: angularjs safari http-headers httpresponse