我正在使用AngularJS $http post方法的响应头来操作location参数。当我检查浏览器时,它显示响应头包含值为location参数,但当涉及到AngularJS响应头对象时,它根本不包含任何东西而是空对象。
$http.post(MNS_DOMAIN + SERVER.MESSAGE_PROXY, JSON.stringify(payload))
.success(function(data, status, headers, config) {
$scope.messageLocation = headers();
$scope.success = SUCESS_DATA_SENT;
clearFormData();
})
.error(function(errorCallback) {
$scope.error = errorCallback;
console.log("Error " + errorCallback);
})
. finally(function() {
console.log("REST call for send message");
});
console.log($scope.error);
};