我正在尝试使用 yahoo boss search 但我收到以下错误
{"error":{"lang":"en-US","description":"请提供有效凭据。OAuth oauth_problem=\"signature_invalid\", realm=\"yahooapis.com\""}}
我正在使用以下代码来启动搜索请求。
OAConsumer *consumer = [[OAConsumer alloc] initWithKey:Consumer-key
secret:Consumer-secret];
NSURL *url = [NSURL URLWithString:@"http://yboss.yahooapis.com/ysearch/images?q=obama&format=json&count=1"];
OAMutableURLRequest *request = [[OAMutableURLRequest alloc] initWithURL:url
consumer:consumer
token:nil // we don't have a Token yet
realm:@"yahooapis.com"
signatureProvider:nil]; // use the default method, HMAC-SHA1
[request prepare];
[request setHTTPMethod:@"POST"];
NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];
上面的代码有什么问题。请帮忙。