【发布时间】:2012-10-05 08:50:19
【问题描述】:
我正在使用 Bing Api,我的问题非常基本。我已经生成了 App 密钥,但是在控制台中输出错误。
我将它用于 JSON 响应
NSString *urlString=[NSString stringWithFormat:@"%@%@%@%@",
@"http://api.search.live.net/json.aspx?Appid=xxxxxxxaxkOatx66TB+CX8qJUIZw=&query=",
text,@"sources=web&web.offset=",offValue];
NSLog(@"%@",urlString);
NSURL *url=[NSURL URLWithString:urlString];
NSData *data=[NSData dataWithContentsOfURL:url];
我打印响应时的输出是
SearchResponse = {
Errors = (
{
Code = 1002;
HelpUrl = "http://msdn.microsoft.com/en-us/library/dd251042.aspx";
Message = "Parameter has invalid value.";
Parameter = "SearchRequest.AppId";
Value = "zKHS8Fm WcwlhCFh8oYWcs VyUYddig=";
}
);
Query = {
SearchTerms = iphone;
};
Version = "2.2";
};
}
这个错误背后的原因是什么?
谢谢大家。
【问题讨论】:
-
我认为我的应用密钥有问题。 (在我的 App 键中有特殊符号 + 和 =)