angularjs - Skype username validation - No Access control allow origin header is present -


i'm following so question perform skype user name validation. when perform http post

post https://login.skype.com/json/validator

data params : new_username='xxx'

using postman chrome plugin, i'm getting below valid response it. so, think api method allowed performed

{   "status": 406,   "status_text": "valid",   "data": {     "markup": "skype name not available",     "alternatives": true,     "fielddetails": "<label>suggestions</label><ul><li><label><input class=\"skypenamesuggestion\" type=\"radio\" name=\"selectskypename\" value=\"keerthivasan.ramanathan1\"/>keerthivasan.ramanathan1</label></li></ul>"   } } 

but, when perform same stuff in angular js service, below error. can explain behind scenes nuances involved? i'm sure preflight response fails. how can make pass? how work postman app in chrome? have made configuration changes http headers in angular

app.config(['$stateprovider', '$urlrouterprovider','$httpprovider',   function($stateprovider, $urlrouterprovider, $httpprovider) {     $httpprovider.defaults.usexdomain = true;     delete $httpprovider.defaults.headers.common['x-requested-with']; 

error xmlhttprequest cannot load https://login.skype.com/json/validator. response preflight request doesn't pass access control check: no 'access-control-allow-origin' header present on requested resource. origin 'http://localhost' therefore not allowed access.

can me understand? also, if knows better option findout, if skype name valid using angular js. please let me know

it looks service you're calling doesn't accept cross domain requests. isn't problem in postman because postman takes information give , builds , executes requests on server side.

since you're using angularjs , spring. try creating new endpoint in spring takes requests angular body:{data params : new_username='xxx'} , posts https://login.skype.com/json/validator end.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -