0

restsharp を使用して、リンクインで作業する共有を取得するのが困難です。これが私のコードです:

    var shareMsg = new
    {
        comment = "Testing out the LinkedIn Share API with JSON",
        content = new
        {
            title = "Test post to LinkedIn",
            submitted_url = "http://www.somewebsite.com",
            submitted_image_url = "http://www.somewebsite.com/image.png"
        },
        visibility = new
        {
            code = "anyone"
        }
    };

    RestClient rc = new RestClient(LinkedInAppInfo.LinkedInBaseApiUrl);
    RestRequest request = new RestRequest(LinkedInAppInfo.SharePostPath, Method.POST);
    request.RequestFormat = DataFormat.Json;
    request.AddParameter("format", "json");
    request.AddBody(shareMsg);
    request.AddParameter("oauth2_access_token", accessToken, ParameterType.GetOrPost);

    RestResponse restResponse = (RestResponse)rc.Execute(request);
    ResponseStatus responseStatus = restResponse.ResponseStatus;

私が得ている結果は次のとおりです。

{
  "errorCode": 0,
  "message": "Couldn't parse share document: error: Unexpected end of file after null",
  "requestId": "06ZU78FUNW",
  "status": 400,
  "timestamp": 1363551953855
}

私が間違っていることについて何か考えはありますか?

4

0 に答える 0