我正在尝试使用来自 Mashape 的 API。当我测试端点(JSON 响应)时,一切正常,但他们提供的 Objective-c 应用程序就绪代码示例不起作用,我收到以下错误:
这是我的代码:
- (IBAction)loadJson:(id)sender
{
NSDictionary* headers = [NSDictionary dictionaryWithObjectsAndKeys:@"xxxxxxxxx", @"X-Mashape-Authorization", nil];
NSDictionary* parameters = [NSDictionary dictionaryWithObjectsAndKeys:[NSURL URLWithString:@"<file url>"], @"files", @"", @"urls", nil];
HttpJsonResponse* response = [[Unirest post:^(BodyRequest* request) {
[request setUrl:@"https://lambda-face-recognition.p.mashape.com/detect"];
[request setHeaders:headers];
[request setParameters:parameters];
}] asJson];
}
有没有办法解决这个问题?
谢谢!