Restkit路由错误

我正在尝试做一个简单的职位login屏幕。 我发布一个电子邮件地址和密码。 这给了我一个带有状态码的JSON。 如果这个代码是200,它也包含一个person对象。 如果是其他东西,它包含一个错误对象。

我有这个张贴的代码。

RKObjectManager *manager = [RKObjectManager managerWithBaseURL:[NSURL URLWithString:@"http://******.com.be/nl/webservice/company-user/login/apikey/key**"]]; NSDictionary *dictionary = @{ @"email": _txtLogin.text, @"pwd": _txtPass.text}; NSMutableURLRequest *request = [manager requestWithObject:nil method:RKRequestMethodPOST path:nil parameters:dictionary]; RKObjectRequestOperation *operation = [manager objectRequestOperationWithRequest:request success:^(RKObjectRequestOperation *operation, RKMappingResult *result) { NSLog(@"Loading mapping result: %@", result); } failure:nil]; [operation start]; 

但是这个代码导致了下面的错误。

 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: route' *** First throw call stack: 

有人能帮我吗? 我新来restkit。

亲切的问候

您正在尝试使用自动路由发布对象,但是,您的对象为零。 因此,它将依靠path参数来计算POST到的位置。 这也是零。

您需要使用通用的基本URL创build对象pipe理器,例如。 http://******.com.be/nl/webservice/company-user并为你的方法提供path参数/login/apikey/key**