0

OTP 実装用に nexmoverify REST API を実装しようとしていますが、応答オブジェクト comig null.I は Postman にチェックインし、応答オブジェクトから stringify オブジェクトを取得できました。

var app = angular.module('angularjs-starter', []);
app.config(['$httpProvider', function($httpProvider) {
   $httpProvider.defaults.useXDomain = true;
   delete $httpProvider.defaults.headers.common['X-Requested-With'];
}
]);

app.controller('MainCtrl', function($scope, $http) {


   $scope.addNewChoice = function () {
      console.log('aaaa');
      $scope.res=$http.get("https://api.nexmo.com/verify/json?api_key=56a9b1af&api_secret=XXXXXX&number=919650298011&brand=stayuncle").
         success(function (response) {
            $scope.res = response.data;


         }).
      error(function (response){
            console.log(response);

            $scope.res = response.data;


         });


   };

コード フロー:code flow coming to error() section and then printing null in web console.

エラー :

Response object coming null as well as getting this error in web console 

XMLHttpRequest cannot load https://api.nexmo.com/verify/json?api_key=56X9b1af&api_secret=d3XXXX&number=91XX50298011&brand=stayuncle. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.

誰かがこの問題を解決するのを手伝ってくれますか?

4

1 に答える 1