我有一个应用程序,我在我的应用程序中集成了linkedin。我想获取登录用户的连接。为此,我已经完成了代码,但它返回错误:
{
"errorCode": 0,
"message": "Unknown authentication scheme",
"requestId": "98TKWP0T23",
"status": 401,
"timestamp": 1355726431107
}
这是我所做的代码:-
(NSMutableArray*) getFriendsList
{
NSString *url1 = [NSString stringWithFormat:@"http://api.linkedin.com/v1/people/id=%@:(connections)?format=application/json",linkedinid];
NSLog(@"%@",url1);
NSURL *url = [NSURL URLWithString:url1];
OAMutableURLRequest *request = [[OAMutableURLRequest alloc]
initWithURL:url
consumer:consumer
token:token
callback:nil
signatureProvider:nil];
[request setValue:@"json" forHTTPHeaderField:@"x-li-format"];
[request setHTTPMethod:@"POST"];
NSError *err;
NSURLResponse *resp;
NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:&resp error:&err];
NSMutableArray *arr = [[NSMutableArray alloc] init];
if (response != nil)
{
NSString *stringResponse = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
SBJSON *parser = [[SBJSON alloc] init];
NSDictionary *linkedin_response = [parser objectWithString:stringResponse error:nil];
}
}
但在 stringresponse 它返回上述错误。