我是restkit的新手。我按照github的说明成功集成了restkit 0.20.0-pre6。然后我在控制台中构建了我的项目,我得到了以下
restkit:RKLog.m:34 RestKit 日志记录已初始化...
之后我想在路径上获取数据
最初有一个激活屏幕。所以我想向它发送激活码,如果正确,我想获得相应的详细信息。
NSURL *urll=[NSURL URLWithString:@"http://url/FirstRest/rest/application/Activate"];
AFHTTPClient* client = [[AFHTTPClient alloc] initWithBaseURL:urll];
RKObjectManager *manager = [[RKObjectManager alloc] initWithHTTPClient:client];
[RKObjectManager setSharedManager:manager];
Article *article = [Article new];
article.activationCode = @"S1234";
[manager.router.routeSet addRoute:[RKRoute routeWithClass:[Article class] pathPattern:@"/FirstRest/rest/application/Activate/:activationCode" method:RKRequestMethodGET]];
[[RKObjectManager sharedManager] getObject:article path:nil parameters:nil success:^(RKObjectRequestOperation *operation, RKMappingResult *result)
{
// Request
NSLog(@"result is ************* %@",result);
} failure:^(RKObjectRequestOperation *operation, NSError *error) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:[error localizedDescription] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
}];
`
在我的控制台中,我得到了
I restkit.network:RKHTTPRequestOperation.m:179 GET 'http://url/FirstRest/rest/application/Activate/S1234' (200 OK) [1.4744 s]
2013-01-28 14:07:59.284 Polls[985:15103] E restkit.network:RKResponseMapperOperation.m:240 无法解析响应数据:加载了内容类型为“application/json”的无法处理的响应 (200)
我无法找出它的真正含义以及如何克服它