【发布时间】:2015-03-31 12:07:33
【问题描述】:
我正在使用以下代码让用户关注另一个 Instagram 用户。但是,即使结果返回成功(meta.code==200),API 仍然不允许关注。
我现在明白这是因为 JSONP 使用的是脚本标签和 GET。是设置代理服务器的解决方案吗?如果是这样,你能演示一下如何做到这一点的代码吗?
非常感谢!
$.ajax({
type: "POST",
"method": "POST",
url: 'https://api.instagram.com/v1/users/' + followID + '/relationship?access_token=' + accessToken + '&callback=callbackFunction',
data: {action: 'follow'},/*need this to access the relationship*/
dataType: "jsonp",
success: function(result){
if (result.meta.code == 200) {
document.getElementById(followID).innerHTML = "Requested";
document.getElementById(followID).style.display = "none";
document.getElementById("reqID" + followID).style.display = "block";
alert(result.data.outgoing_status;);
}
}
});
【问题讨论】:
标签: api instagram proxy-server