【发布时间】:2012-05-19 19:36:13
【问题描述】:
我有以下 JSON 解析代码:
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.dropbox.com/s/qz16qyi3julygl9/facebook.json"]];
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
NSLog(@"Request Success %@",[JSON class]);
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
NSLog(@"Request Failure Because %@",[error userInfo]);
}];
[operation start];
但我的请求失败并显示以下错误消息:
NSErrorFailingURLKey = "https://www.dropbox.com/s/qz16qyi3julygl9/facebook.json"; NSLocalizedDescription = "预期的内容类型 {(\n \"text/json\",\n \"application/json\",\n \"text/javascript\"\n)},得到 text/html";
有人可以帮我吗?
【问题讨论】:
标签: ios json afnetworking