欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

服务器如何返回429状态,Instagram远程服务器返回一个错误:(429)UNKNOWN STATUS CODE...

发布时间:2023/12/1 53 豆豆
生活随笔 收集整理的这篇文章主要介绍了 服务器如何返回429状态,Instagram远程服务器返回一个错误:(429)UNKNOWN STATUS CODE... 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

我正在使用我自己的instagram api开发一些新程序。 一切都与我工作正常,除了以下的用户脚本 我想按照我的用户ID 的名单,所以我用这个代码Instagram远程服务器返回一个错误:(429)UNKNOWN STATUS CODE

foreach (var item in listBox1.Items)

{

WebRequest request = WebRequest.Create("https://api.instagram.com/v1/users/"+item+"/relationship?access_token=" + Common.token2);

request.Proxy = null;

request.Method = "POST";

string postData = "action=follow";

byte[] byteArray = Encoding.UTF8.GetBytes(postData);

// Set the ContentType property of the WebRequest.

request.ContentType = "application/x-www-form-urlencoded";

// Set the ContentLength property of the WebRequest.

request.ContentLength = byteArray.Length;

// Get the request stream.

Stream dataStream = request.GetRequestStream();

dataStream.Write(byteArray, 0, byteArray.Length);

dataStream.Close();

WebResponse response = request.GetResponse();

// Display the status.

MessageBox.Show(((HttpWebResponse)response).StatusDescription);

dataStream.Close();

response.Close();

new System.Threading.Thread(GetInfo).Start();

Thread.Sleep(TimeSpan.FromSeconds(2));

}

listBox1.Items.Clear();

它遵循前5成功然后将其与

The remote server returned an error: (429) UNKNOWN STATUS CODE.

+0

https://en.wikipedia.org/wiki/List_of_HTTP_status_codes 429是“请求太多”。这可以帮助你解决你的问题。 –

+0

你我知道有太多的请求如何解决它? –

+0

现在,当我把它设置为睡5秒时,它只遵循前17 –

总结

以上是生活随笔为你收集整理的服务器如何返回429状态,Instagram远程服务器返回一个错误:(429)UNKNOWN STATUS CODE...的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。