1

我看到一篇文章如何使用 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);

它给了我一个错误“错误请求”。如何解决这个问题请帮助我..?

4

0 回答 0