我正在使用AngularJS中的$resource
尝试读取标头位置。
输出:
headers()
Object {}No Properties
var Devices = $resource(':deviceId', null, {
save: {
method: 'POST'
}
}
function abcadd(customerId, devices) {
var headers = {};
headers = { 'Access-Control-Expose-Headers': 'Location' }
var parameters = {
$headers: headers,
customerId: customerId
};
return Devices.save(parameters, devices, function (data, headers) {
console.log(data);
console.log(headers());
});
}