在LinkedIn发布状态

时间:2013-01-10 06:19:28

标签: c# c#-4.0 linkedin hammock

我看到一位艺术家如何使用c#在LinkedIn上分享我们的状态 我遵循这些步骤,我正在使用的代码遵循...
为此,我使用的是Hammock库。

        OAuthCredentials credentials = new OAuthCredentials();

        credentials.Type = OAuthType.AccessToken;
        credentials.ConsumerKey = "****";
        credentials.ConsumerSecret = "*****";
        credentials.Token = "******";
        credentials.TokenSecret = "*********";
        credentials.SignatureMethod = OAuthSignatureMethod.HmacSha1;
        credentials.ParameterHandling = OAuthParameterHandling.HttpAuthorizationHeader;


        RestClient client = new RestClient();

        client.Authority = "http://api.linkedin.com/v1";
        client.Credentials = credentials;
        client.Method = WebMethod.Put;
        byte[] msg = Encoding.Default.GetBytes("Test");
        client.AddHeader("Content-Type", "text/xml");
        client.AddPostContent(msg);


        RestRequest request = new RestRequest();
        request.Path = "http://api.linkedin.com/v1/people/~/current-status";


 /* ERROR */ RestResponse response = client.Request(request);

它给了我一个错误“错误请求”。 怎么解决这个请帮帮我..?

0 个答案:

没有答案