我正在使用Windows Azure Marketplace上提供的Bing Search API。
Subscription Type: Bing Search API (5000 transactions per month free).
我已获得帐户密钥。
我仍然得到回应
**The authorization type you provided is not supported.Only Basic and OAuth are supported**
当我在浏览器中复制url时,它会询问用户名和密码(只有密码是强制性的,它只是帐户密钥),验证后我可以看到XML / JSON格式的数据。
我如何通过我的计划实现这一目标?
我的代码是:
NSString *urlString = [NSString stringWithFormat:@"%s","https://api.datamarket.azure.com/Data.ashx/Bing/Search/v1/Web?$format=json&$top=8&Query='querystring'"];
NSURL *url = [NSURL URLWithString:urlString];
NSData *data = [NSData dataWithContentsOfURL:url];
NSLog(@"%@",[[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding]) ;
NSURLRequest *request = [NSURLRequest requestWithURL:url] ;
NSURLConnection *connection = [NSURLConnection connectionWithRequest:request delegate:self];
[connection start] ;