私はです。Linkedin Personに新しい共有を送信しようとしています。ハンモックライブラリを使用してLinkedInに共有を投稿する際のエラー
RestClient client = new RestClient()
{
Authority = "http://api.linkedin.com/v1",
Credentials = this.AccessCredentials(connectionData.ApplicationKey, connectionData.ApplicationSecret, connectionData.AccessToken, connectionData.AccessSecret),
Method = WebMethod.Post,
Encoding = Encoding.UTF8,
};
RestRequest request = new RestRequest()
{
Path = "people/~/shares",
Encoding = Encoding.UTF8,
};
Share share = new Share(socialMessage.Text, socialMessage.Name, socialMessage.Description, VisibilityCode.Anyone);
share.Content.SubmittedImageUrl = socialMessage.PictureLink;
share.Content.SubmittedUrl = socialMessage.Link;
String content = Utilities.SerializeToXml<Share>(share);
client.AddPostContent(System.Text.Encoding.UTF8.GetBytes(content));
client.AddHeader("Content-Type", "text/xml");
request.AddPostContent(System.Text.Encoding.UTF8.GetBytes(content));
request.AddHeader("Content-Type", "text/xml");
RestResponse response = client.Request(request);
私はいつも「ヌル後の予期しないファイルの終わり:エラー共有ドキュメントを解析できませんでした」のコールの後にこのエラーメッセージを得る:これは私のクライアントコードです。
誰かがHammockライブラリを使用してLinkedInにPOSTを送信する方法を教えていただけますか? http://developer.linkedin.com/documents/debugging-api-calls
のヒントを使用して
おかげ&よろしく
おかげで、私は現在の問題もなく、LinkedInのツールキットを別のライブラリを使用しています。私はエラーがLinkedIn APIに起因するとは思わない。ハンモックでデバッグをやろうとします。 –
@Kristen Jones私はあなたに質問があります:LinkedIn API、特に 'people /〜/ shares'は、 "nullの後のファイルの予期しない終了"というエラーメッセージを送信しますか? –
通常これは、コンテンツタイプが正しく送信されないか、POST本体自体が空であることを意味します。 –