anglejsを使用して 'https://connect.squareup.com/v2/locations'にリクエストを行い、403 FORBIDDENの呼び出しに失敗しました。ここでRequest Forbidden 403ローカルホストからのSquare-Connectへのリクエスト
は、コードサンプルです:
var url = 'https://connect.squareup.com/v2/locations';
var config = {
headers: {
'Authorization': 'Bearer sandbox-sq0atb-JJGltCa375qzAyoQbjPgmg',
'Accept': 'application/json',
"X-Testing": "testing"
}
};
$http.get(url, config)
.then(
function (response) {
console.dir(response);
},
function (response) {
console.log("failed" + response)
}
);
私は上記のサンプルのフィドルを行いました。どんな助けもありがとうございます。 XMLHttpRequest cannot load https://connect.squareup.com/v2/locations. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
:
CORSの問題で実行しています。サーバー。 – anoop