$ http.postをIFTTTメーカーチャネルに実行しようとしているときに問題が発生しています。以下は、私はPOSTを実行するために使用していたコードです:
$http.post(
'https://maker.ifttt.com/trigger/{my-event}/with/key/{my-key}',
{value1:"hello",value2:"goodbye"}
).then(
function successCallback(response) {
console.log(response);
},
function errorCallback(response) {
console.log("error: ",response);
});
私が得る応答は以下の通りです:
XMLHttpRequest cannot load https://maker.ifttt.com/trigger/{my-event}/with/key/{my-key}.
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access.
私はコルドバ-ホワイトリストプラグインを持っているとするAccess-Control-Origin
を追加するさまざまなソリューションを試してみましたそれでも同様の応答が得られます。
であるあなたは、ここで
クロームそれらを得ることができますか? – Akis
私はそう信じません。私はいくつかのブラウザといくつかのマシンで試してみました。それでも同じエラー。 – zsoflin
CORSプラグインを使用する回避策があります。https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi – Akis