【发布时间】:2019-11-09 08:59:05
【问题描述】:
我想通过使用对端点的请求来取消关注 instagram 上的特定用户,为此我使用了 fiddler 来查找。 但是我收到 403 错误,但什么也没发生。我是这方面的新手。
代码如下:
var http = new XMLHttpRequest();
var url = 'https://www.instagram.com/web/friendships/8752655712/unfollow/';
var params = 'orem=ipsum&name=binny';
http.open('POST', url, true);
//Send the proper header information along with the request
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
http.onreadystatechange = function() {//Call a function when the state changes.
if(http.readyState == 4 && http.status == 200) {
alert(http.responseText);
}
}
http.send(params);
我是否缺少任何技术方面的内容?
编辑 1:我在登录到我的 instagram 帐户时从 chrome 控制台发送它。
【问题讨论】:
标签: javascript http post request xmlhttprequest