我使用的是推特的应用程序接口,而我尝试发送的SLRequest参数似乎被忽略了:
SLRequest *request = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodGET URL:[NSURL URLWithString:@"https://api.twitter.com/1.1/statuses/home_timeline.json"] parameters:@{@"count":@50}];
[request setAccount:self.twitterAccount];
[request performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {...}];在这里,尽管我给了它一个count=50参数,但我只收到了20条tweet。当我使用Charles Proxy查看连接时,我没有看到请求中的任何地方都发送了这个参数。为什么SLRequest不考虑我的参数?
发布于 2014-07-31 09:20:24
事实证明, SLRequest唯一接受的参数类型是NSString。所以我应该发送@{@"count":@"50"}而不是@{@"count":@50}。
https://stackoverflow.com/questions/25049460
复制相似问题