6

I am using Bing Api, My problem is very basic. I already generated App key, but I got error in output in console.

I am using 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];

output when i print respose is

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 behind this error?

thanks All.

QueueOverFlow
  • 1,336
  • 5
  • 27
  • 48

1 Answers1

0

The parameter you are reading sending in the server request contains wrongly spelled.Please give the proper names as similar to server implmentation.Just ask server code team to give request parameter names,and give the proper naming convention.It will fix the issue.The request should be key value pair,not like a string with all values separated by commas.Please give the correct request format.