响应200OK但代码进入restkit中的故障块

时间:2017-12-18 14:05:56

标签: restkit rkobjectmapping

我已连接查尔斯来检查通话的响应。响应头返回200OK,但即使这样,代码也会进入故障块。它是否必须对定义映射的方式做任何事情,还是其他一些微不足道的问题?

NSString *reviewsRequest = [NSString stringWithFormat:@"reviews/%@", reviewerId];
[MTAuthHandler refreshTokenIfExpired:^(id result, NSError *error) {
    [MTRestkitManager instance].objectManager.requestSerializationMIMEType = RKMIMETypeJSON;

    [[MTRestkitManager instance].objectManager getObjectsAtPath:reviewsRequest parameters:nil success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
        NSLog(@"success");
        if (completion) {
            completion(YES, nil);
        }
    } failure:^(RKObjectRequestOperation *operation, NSError *error) {
        NSLog(@"failed");
        if (completion) {
            completion(NO, error);
        }
    }];
}];

错误消息显示 - NSLocalizedDescription =预期状态代码(400-499),得到200

任何指针都将受到高度赞赏。

0 个答案:

没有答案