Reputation: 835
I have ember app which show Instagram images.I am making the request to Instagram api to user information like profile pic and username but I am getting the error
Error
XMLHttpRequest cannot load https://api.instagram.com/v1/users/self/?access_token=25634653241563.63765274276357. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.example.co.in' is therefore not allowed access.
In the Instagram Manage client I have filled the website as "http://example.co.in"
The Request
raw({
url:"https://api.instagram.com/v1/users/self/?access_token=25634653241563.63765274276357",
crossDomain: true,
}).then(function(response){
console.log(response)
})
Upvotes: 0
Views: 988
Reputation: 12872
Before calling ajax request you can configure ajax setup settings to allow cross domain origin request..
Ember.$.ajaxSetup({ xhrFields: { withCredentials: true }, crossDomain: true }); This will take care of the appending cookie settings to each request.
Upvotes: 1