Created
November 12, 2016 17:07
-
-
Save tanerochris/f57751ec0b0717944e9edf42f2d4cf09 to your computer and use it in GitHub Desktop.
click a tell CORS problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script> | |
</head> | |
<body ng-app="myApp"> | |
<button ng-click="click()">Send Message</button> | |
<script type="text/javascript"> | |
angular.module("myApp",[]).controller("testCntr",function($scope,$http){ | |
var authorization = "Bearer "+ "zu.5_21RmO1Sl5h1RRiGDZVEy.tjD8D5u9UneijpFBeMTrNE7SI990wfrLSR6pT6kD9fLG0vww3eBs"; | |
$scope.click = function(){ | |
var message = { | |
"text" : "1235", | |
"to":["***********"]//replace *** with numbers | |
}; | |
$http.post('https://api.clickatell.com/rest/message',message,{ | |
"headers":{ | |
"Authorization" :authorization | |
} | |
}).then(function(response){ | |
console.log(response); | |
},function(httpError){ | |
console.log(httpError); | |
}); | |
} | |
</script> | |
</body> | |
</html> | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
here is warning
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.clickatell.com/rest/message. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).