Bing Api doesn't work for me

I am using Bing Api, my problem is very simple. I already generated the App key, but I got an error in the output in the console.

I use this for JSON response

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]; 

conclusion, when I type respose,

 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"; }; 

}

What is the reason for this error?

thank you all.

+6
source share
1 answer

The parameter that you read when sent in the server request contains erroneously written. Please provide names that are similar to server implementation. Just ask the server server command to provide the query parameter names and give the correct naming convention. issue.The query should be a key pair of values, not a string with all values ​​separated by commas. Please indicate the correct request format.

0
source

Source: https://habr.com/ru/post/927013/


All Articles