아래의 코드를 사용하여 다른 Instagram 사용자를 따라갈 수 있습니다. 그러나 결과가 긍정적 인 성공을 반환하더라도 (meta.code == 200), API는 여전히 follow를 허용하지 않습니다.Instagram API - POST를 위해 프록시 서버를 설치하는 방법 사용자를 따라갈 것을 요청합니다.
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;);
}
}
});