質問させていただきます。
getリクエストしてとあるWebAPIのリソースを取得したいのですが
XMLHttpRequest cannot load https://www.abc.jp/api/getPlanList?&username=hogehoge&password=hogehoge&did=16&sid=29&ymd=20160805. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://0.0.0.0:8100' is therefore not allowed access.
といったエラーでてしまっています。
解決方法をご教示頂けると幸いです。
何卒よろしくお願いいたしますm(_ _)m
`$scope.search = function() {
var headers = { 'Access-Control-Allow-Origin' : '*', 'Access-Control-Allow-Methods' : 'POST, GET, OPTIONS, PUT', 'Content-Type': 'application/json', 'Accept': 'application/json' }; $http({ method: 'GET', url: "https://www.abc.jp/api/getPlanList?&username=hogehoge&password=hogehoge&did=16&sid=29&ymd=20160805", headers:headers }).then(function successCallback(response) { // ok }, function errorCallback(response) { console.log(response); });
`
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。