我想通過代碼在Twitter上關注用戶。我正在使用下面提到的代碼。如何在Twitter上關注用戶?
HttpWebRequest messageRequest =
(HttpWebRequest)WebRequest.Create("http://twitter.com/friendships/create/" +
userIdToFollow + ".xml?follow=true");
messageRequest.Method = "POST";
messageRequest.Credentials = new NetworkCredential(username, password);
messageRequest.ContentLength = 0;
messageRequest.ContentType = "application/x-www-form-urlencoded";
WebResponse response = messageRequest.GetResponse();
StreamReader sReader = new StreamReader(response.GetResponseStream());
responseStr = sReader.ReadToEnd();
而得到響應
The remote server returned an error: (404) Not Found.
我失去的東西,我得到一個錯誤?
你能給一些示例代碼。這將是非常有用的。感謝您的回覆 – SCV
https://dev.twitter.com/docs/api/1.1/post/friendships/create – hunter
迄今爲止的幫助hunter +1:感謝您的幫助。你能修改我的代碼來使它工作嗎? – SCV