Twitter,Oauth,关注用户

3

我正在尝试使用C#开发Twitter。

我正在使用以下Oauth方法提交新推文:

string xml = _oAuth.oAuthWebRequest(
                oAuthTwitter.Method.POST,
                "http://twitter.com/statuses/update.xml",
                "status="+tweet);

我如何关注一个用户?我在哪里可以找到所有oAuthWebRequest的支持,例如关注用户、检查用户是否关注我、取消关注用户等。
提前致谢。
编辑:
根据这些说明,我尝试了以下操作: http://www.lordyz.co.uk/2010/10/01/c-asp-net-twitter-api-oauth-example-continued/ string friend = HttpUtility.UrlEncode("ladygaga");
    string xml = _oAuth.oAuthWebRequest(  
    oAuthTwitter.Method.POST,  
    "http://api.twitter.com/1/friendships/create/" + friend + ".xml", ""); 

这个有效!谢谢

1个回答

0
你应该使用这个REST调用的链接 - https://api.twitter.com/1/friendships/create.xml,并且你应该通过POST发送你的数据。在你的样例中,你正在使用oAuthTwitter.Method.POST,但是你把你的数据放在URL中而不是POST中。
如果我正确理解oAuthWebRequest的签名,那么你应该像这样做:
string friend = "ladygaga";
string xml = _oAuth.oAuthWebRequest(
                    oAuthTwitter.Method.POST, 
                    "https://api.twitter.com/1/friendships/create.xml", 
                    "screen_name=" + friend); 

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接