我正在使用我自己的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 –