【发布时间】:2014-09-30 15:59:29
【问题描述】:
我正在尝试在 LinkedIn 中分享一些内容。我正在获取用户个人资料,但我无法使用此代码分享帖子:
[self.client GET:[NSString stringWithFormat:@"https://api.linkedin.com/v1/people/~:(id,picture-url,email-address,first-name,last-name,headline,location,industry,positions,educations)?oauth2_access_token=%@&format=json", accessToken] parameters:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *result) {
NSLog(@"current user %@", result);
[self.client POST:[NSString stringWithFormat:@"https://api.linkedin.com/v1/people/~/shares/?comment=test&title=commentTest&oauth2_access_token=%@&format=json",accessToken] parameters:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *result) {
NSLog(@"result share %@",result);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"failed to post %@", error);
}];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"failed to fetch current user %@", error);
}];
我已经阅读了这篇文档文章https://developer.linkedin.com/documents/writing-linkedin-apis,但我不明白的是,他们的意思是我们在请求中发布了整个 json 还是 xml?如果是这样,您有解决方案吗?
【问题讨论】:
标签: ios objective-c linkedin