保存access token后再次登陆获取home_timeline时
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObject:@"5" forKey:@"count"];
[self.sinaweibo requestWithURL:@"statuses/home_timeline"
params:params
httpMethod:@"GET"
delegate:self];
出现如下错误:
Error Domain=SinaWeiboSDKErrorDomain Code=200 "Data parse error" UserInfo=0x7589900 {NSLocalizedDescription=Data parse error, error=Error Domain=JKErrorDomain Code=-1 "Unexpected token, wanted '{', '}', '[', ']', ',', ':', 'true', 'false', 'null', '"STRING"', 'NUMBER'." UserInfo=0x7589a10 {JKAtIndexKey=0, JKLineNumberKey=1, NSLocalizedDescription=Unexpected token, wanted '{', '}', '[', ']', ',', ':', 'true', 'false', 'null', '"STRING"', 'NUMBER'.}}
原来发现是requestWithURL拼写错误,漏泄了后缀.json, 正确写法是:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObject:@"5" forKey:@"count"];
[self.sinaweibo requestWithURL:@"statuses/home_timeline.json"
params:params
httpMethod:@"GET"
delegate:self];