localhost から Google API にアクセスしようとしています。クロムは起源のためにそれは不可能だと言っています
XMLHttpRequest cannot load https://maps.googleapis.com/maps/api.... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.
私はhttps-browserify
ajaxリクエストを行うために使用しています。
options = {
hostname: "maps.googleapis.com",
port: 443,
path: "/maps/api/....",
method: "get",
headers: {
"Origin": null,
"Referer": null
}
};
result = null;
req = https.request(options, function(res) {
res.on("data", function(chunk) {
return result += chunk;
});
return res.on("end", function() {
debugger;
});
});
req.end();
しかし、これは役に立ちませんでした。Origin
このリクエストを行うとき、Referer
ヘッダーはまだそこにあります。どうすれば削除できますか?