Oauth Consumer - LinkedIN 更新状态
我尝试开发一个使用 OauthConsumer 与 LinkedIN 连接的应用程序。 一切正常,我可以提取用户数据,但是当我想更新用户状态时,我出现状态错误 401,并显示消息 [未经授权]。 我有访问令牌,这是代码:
NSURL *url = [NSURL URLWithString:@"https://api.linkedin.com/v1/people/~/current-status"];
OAMutableURLRequest *request1 = [[OAMutableURLRequest alloc] initWithURL:url
consumer:consumer
token:accToken//
realm:nil //
signatureProvider:nil] ; //
NSLog(@"mytoken%@",[request1 token]);
[request1 setHTTPMethod:@"PUT"];
[request1 setHTTPBodyWithString:@"<?xml version=''1.0'' encoding=''UTF-8'?><current-status>is setting their status using the LinkedIn API.</current-status>"];
OADataFetcher *fetcher = [[OADataFetcher alloc] init];
[fetcher fetchDataWithRequest:request1
delegate:self
didFinishSelector:@selector(status:didFinishWithData:)
didFailSelector:@selector(status:didFailWithError:)];
有什么想法吗???请帮助我!!!! :( tnx
I try to develop a app that use OauthConsumer for connection with LinkedIN.
All work fine, I can extract the user data but when I want to update User status I've status error 401 with message [unauthorized].
I've the access token, this is the code:
NSURL *url = [NSURL URLWithString:@"https://api.linkedin.com/v1/people/~/current-status"];
OAMutableURLRequest *request1 = [[OAMutableURLRequest alloc] initWithURL:url
consumer:consumer
token:accToken//
realm:nil //
signatureProvider:nil] ; //
NSLog(@"mytoken%@",[request1 token]);
[request1 setHTTPMethod:@"PUT"];
[request1 setHTTPBodyWithString:@"<?xml version=''1.0'' encoding=''UTF-8'?><current-status>is setting their status using the LinkedIn API.</current-status>"];
OADataFetcher *fetcher = [[OADataFetcher alloc] init];
[fetcher fetchDataWithRequest:request1
delegate:self
didFinishSelector:@selector(status:didFinishWithData:)
didFailSelector:@selector(status:didFailWithError:)];
Any ideas??? Plese help me!!!!!! :(
tnx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,正确的代码是下一个:
OK, the rigth code is the next: