我正在上尝试在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);在调用“无法解析共享文档: error: null后文件的意外结束”之后,我总是获得此错误消息。
有人能告诉我如何使用Hammock库向LinkedIn发送帖子吗?
致谢和问候
发布于 2012-07-25 09:00:40
这里也有可能的解决方案:https://github.com/danielcrenna/hammock/issues/4
发布于 2012-01-24 21:20:44
我不知道如何使用吊床库,但您可以使用LinkedIn (或任何其他web服务)的http://developer.linkedin.com/documents/debugging-api-calls技巧来调试API调用
这将向您展示如何安装HTTP嗅探器,并监视流量以查看发生了什么。一旦您这样做了,如果您仍然有问题,发布它们,它将有可能调试什么是错误的。
https://stackoverflow.com/questions/8883708
复制相似问题