gpt4 book ai didi

objective-c - Restkit Post总是会出现故障

转载 作者:行者123 更新时间:2023-12-01 16:52:57 25 4
gpt4 key购买 nike

我有一个restkit函数,可以在其中调用Web服务来检查我的登录凭据。在此 call 中,我将我的电子邮件和密码作为参数。在这里您可以看到代码。

RKObjectManager *manager = [RKObjectManager managerWithBaseURL:[NSURL URLWithString:@"http://****.com/nl/webservice/"]];


NSDictionary *dictionary = [[NSDictionary alloc]initWithObjectsAndKeys:_txtLogin.text,@"email",_txtPass.text,@"pwd", nil];
NSLog(@"till here");
NSMutableURLRequest *request = [manager requestWithObject:nil method:RKRequestMethodPOST path:@"company-user/login/apikey/key*****?" parameters:dictionary];
NSLog(@"till here2");
RKObjectRequestOperation *operation = [manager objectRequestOperationWithRequest:request success:^(RKObjectRequestOperation *operation, RKMappingResult *result) {
NSLog(@"till here3");
NSLog(@"Loading mapping result: %@", result);
}failure:^(RKObjectRequestOperation *operation, NSError *error){
//Failure
NSLog(@"error is:%@ ",error);
NSLog(@"FAILUREE!");
}];

NSLog(@"till here4");
[operation start];
NSLog(@"till here5");

但是由于某种原因,我进入了失败部分。它首先给我200的状态,然后是错误。您可以在这里查看我的日志。
2013-01-07 20:33:45.858 Offitel2[26195:c07] till here
2013-01-07 20:33:45.859 Offitel2[26195:c07] till here2
2013-01-07 20:33:45.860 Offitel2[26195:c07] till here4
2013-01-07 20:33:47.252 Offitel2[26195:c07] till here5
2013-01-07 20:33:47.254 Offitel2[26195:c07] I restkit.network:RKHTTPRequestOperation.m:152 POST 'http://virtuele-receptie.preview.sanmax.be/nl/webservice/company-user/login/apikey/key12345678?'
2013-01-07 20:33:47.255 Offitel2[26195:c07] I restkit.network:RKHTTPRequestOperation.m:179 POST 'http://virtuele-receptie.preview.sanmax.be/nl/webservice/company-user/login/apikey/key12345678?' (200 OK) [0.0005 s]
2013-01-07 20:33:47.255 Offitel2[26195:c07] error is:Error Domain=org.restkit.RestKit.ErrorDomain Code=1001 "No response descriptors match the response loaded." UserInfo=0xa869130 {NSErrorFailingURLStringKey=http://virtuele-receptie.preview.sanmax.be/nl/webservice/company-user/login/apikey/key12345678?, NSLocalizedFailureReason=A 200 response was loaded from the URL 'http://virtuele-receptie.preview.sanmax.be/nl/webservice/company-user/login/apikey/key12345678?', which failed to match all (0) response descriptors:, NSLocalizedDescription=No response descriptors match the response loaded., keyPath=null, NSErrorFailingURLKey=http://virtuele-receptie.preview.sanmax.be/nl/webservice/company-user/login/apikey/key12345678?, NSUnderlyingError=0xa8695b0 "No mappable object representations were found at the key paths searched."}
2013-01-07 20:33:47.256 Offitel2[26195:c07] FAILUREE!

有人可以帮我吗?

亲切的问候

最佳答案

如果您希望对响应进行对象映射以调用Web服务,则必须提供响应描述符。请查看https://github.com/RestKit/RestKit/wiki/Object-Mapping以获得说明和示例。

关于objective-c - Restkit Post总是会出现故障,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14202710/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com