Iphone 在yelp url中传递两个术语时签名无效
我正在尝试使用OAuth库进行yelp查询 这是密码Iphone 在yelp url中传递两个术语时签名无效,iphone,objective-c,cocoa-touch,yelp,Iphone,Objective C,Cocoa Touch,Yelp,我正在尝试使用OAuth库进行yelp查询 这是密码 NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@"http://api.yelp.com/v2/search?term=petrol+restaurants&ll=%f,%f&radius_filter=300",coordinate.latitude,coordinate.longitude]]; OAConsumer *consumer
NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@"http://api.yelp.com/v2/search?term=petrol+restaurants&ll=%f,%f&radius_filter=300",coordinate.latitude,coordinate.longitude]];
OAConsumer *consumer = [[OAConsumer alloc] initWithKey:consumerKey secret:consumerSecret];
OAToken *token = [[OAToken alloc] initWithKey:tokenUrl secret:tokenSecret];
id<OASignatureProviding, NSObject> provider = [[OAHMAC_SHA1SignatureProvider alloc] init];
NSString *realm = nil;
OAMutableURLRequest *request = [[OAMutableURLRequest alloc] initWithURL:URL
consumer:consumer
token:token
realm:realm
signatureProvider:provider];
[request prepare];
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
connection = nil;
它包含+但当我使用+时,它会给出上述错误我用UTF8编码字符串,现在工作正常您的代码很好,请访问yelp api文档,了解如何在单个查询中使用多个参数,并查看是否可能,希望这会有所帮助you@Talha这是文档中的一个示例请求根据您的示例请求,在我看来,在搜索确切的单词时,该请求很好,例如奶油泡芙是食品名称,因此在请求中写为奶油+泡芙(+)加号表示这是一个单词,而你的单词汽油+燃料不是一个单词。这是两个不同的术语,你可以用汽油+泵或燃料+加油站等来表示,希望这能有所帮助you@Talha不,它不像奶油+泡芙会产生同样的错误。yelp api文档简要描述了搜索术语吗?您能发布一个工作代码的示例吗?我根本不能让我的工作。
http://api.yelp.com/v2/search?term=cream+puffs&location=San+Francisco