I am trying to register like API call to instagram.
As their dev site told me I call like
InstagramAPI.prototype.like = function(){
var access_token = '211611405.1677ed0.4e0e854196454874b858e21c293b919d';
var mediaId = '448979387270691659_45818965';
var apiUrl = 'https://api.instagram.com/v1/media/' + mediaId + '/likes';
$.post(apiUrl, {access_token : access_token}, function(data){
console.log(data);
}, 'jsonp').done(function(result){
console.log(result);
}).fail(function(err){
console.error(err);
});
}
However, when I inspect with browser tool, it sends GET request and get people who likes that photos.
I have tried this with $.ajax()
with ?callback=?
parameters and it also does not work.
The main error is
- using
json
type makes Same origin policy problem - Sending
Post
request automatically change intoGet
request
How can I fix this? Thanks.
P.S.
I already read those articles to fix this, but does not work for me :<