0
嘗試發送名爲Authorization的Header時,這是響應。無法從瀏覽器以及其他客戶端發送Headers授權
Access-Control-Allow-Headers → origin, x-requested-with, content-type
Access-Control-Allow-Methods → PUT, GET, POST, DELETE, OPTIONS
Access-Control-Allow-Origin → *
Connection → close
Content-Type → application/json
Date → Sun, 06 Mar 2016 03:48:17 GMT
Server → Apache/2.4.12
Transfer-Encoding → chunked
X-Powered-By → PHP/5.5.31
我送這樣的:
var temp = "oldpassword=" + $scope.oldpassword + "&newpassword=" + $scope.newpassword;
//alert (temp);
$http({
method: 'POST',
url: 'http://<url>/api/v1/change_password2',
data: temp,
headers: {'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': api_key}
}).then(
// do whatever you want to do
)
誰能幫助我這是爲什麼不工作作爲同在本地主機工作完美?