0
我需要執行一個get,並得到從控制檯這個錯誤在HTTP請求頭參數
Request header field client_id is not allowed by Access-Control-Allow-Headers in preflight response.
這是我的頭:
Access-Control-Request-Headers:accept, authorization, client_id
我想從這個調用的請求頭中刪除client_id,而不會影響全局設置。
下面是代碼:
$http.get(url,{
headers: {"client_id": undefined }
})
.success(function (geoData) {
d.resolve(geoData);
})
.error(function (err, status) {
d.reject(err);
});
但它沒有任何效果。我錯過了什麼?