RestKit - RKObjectMapping 仅运行一次

发布于 2025-01-01 02:52:04 字数 11114 浏览 1 评论 0原文

我正在使用 RestKit iOS 包来允许用户从他们拥有的帐户中提取信息。下面的代码第一次运行时效果很好。但是,如果我尝试第二次使用不同的用户名和密码,它只会加载第一次映射调用中的信息。此外,当第二次发送请求时,它返回数据的速度不合理,这让我相信它只是使用缓存的数据。我到处寻找重置restkit(及其缓存)的方法,但没有一个有效。这是我的代码:

- (void)login {
    RKObjectMapping* mapping = [RKObjectMapping mappingForClass:[MyClass class]];
    [mapping mapKeyPathsToAttributes:
     @"Data.MailboxId", @"MailboxId",
     @"Data.value1", @"Value1",
     @"Data.value2", @"Value2",
     nil];


    [RKObjectManager objectManagerWithBaseURL:@"https://my.site.com"];

    [RKObjectManager sharedManager].client.username = username.text;
    [RKObjectManager sharedManager].client.password = password.text;

    [[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"/api/v1.0/?format=json" objectMapping:mapping delegate:self];
}

这是来自 RestKit 的日志:

2012-01-30 11:59:40.413 HostedNumbers[6909:707] D restkit.network:RKClient.m:265 Reachability observer changed for client <RKClient: 0x6f09640>, suspending queue <RKRequestQueue: 0x6f0a5d0 name=(null) suspended=YES requestCount=0 loadingCount=0/5> until reachability to host '0.0.0.0' can be determined
2012-01-30 11:59:40.425 HostedNumbers[6909:707] D restkit.network:RKClient.m:389 Reachability to host '0.0.0.0' determined for client <RKClient: 0x6f09640>, unsuspending queue <RKRequestQueue: 0x6f0a5d0 name=(null) suspended=YES requestCount=1 loadingCount=0/5>
2012-01-30 11:59:40.436 HostedNumbers[6909:707] D restkit.network:RKRequest.m:362 Sending asynchronous GET request to URL https://my.hostednumbers.com/api/v1.0/Mailbox/?format=json.
2012-01-30 11:59:40.445 HostedNumbers[6909:707] T restkit.network:RKRequest.m:310 Prepared GET URLRequest '<NSMutableURLRequest https://my.hostednumbers.com/api/v1.0/Mailbox/?format=json>'. HTTP Headers: {
    Accept = "application/json";
    "Content-Length" = 0;
}. HTTP Body: .
2012-01-30 11:59:43.045 HostedNumbers[6909:707] D restkit.network:RKResponse.m:163 Asked if canAuthenticateAgainstProtectionSpace: with authenticationMethod = NSURLAuthenticationMethodServerTrust
2012-01-30 11:59:43.513 HostedNumbers[6909:707] D restkit.network:RKResponse.m:163 Asked if canAuthenticateAgainstProtectionSpace: with authenticationMethod = NSURLAuthenticationMethodHTTPDigest
2012-01-30 11:59:43.516 HostedNumbers[6909:707] D restkit.network:RKResponse.m:137 Received authentication challenge
2012-01-30 11:59:44.066 HostedNumbers[6909:707] D restkit.network:RKResponse.m:163 Asked if canAuthenticateAgainstProtectionSpace: with authenticationMethod = NSURLAuthenticationMethodServerTrust
2012-01-30 11:59:45.914 HostedNumbers[6909:707] D restkit.network:RKResponse.m:196 NSHTTPURLResponse Status Code: 200
2012-01-30 11:59:45.917 HostedNumbers[6909:707] D restkit.network:RKResponse.m:197 Headers: {
    "Cache-Control" = "no-cache";
    "Content-Length" = 2733;
    "Content-Type" = "application/json; charset=utf-8";
    Date = "Mon, 30 Jan 2012 16:59:46 GMT";
    Expires = "-1";
    Pragma = "no-cache, no-cache";
    Server = "Microsoft-IIS/6.0";
    "X-AspNet-Version" = "2.0.50727";
    "X-Powered-By" = "ASP.NET";
}
2012-01-30 11:59:45.923 HostedNumbers[6909:707] T restkit.network:RKResponse.m:202 Read response body: {"Data":[{"MailboxId":"SP6s2m5zgwze47lsN5bBew2","PhoneNumberList":[{"PhoneNumber":"1-877-564-7397","Description":"(877) 564-7397","Provisioned":true,"PhoneNumberId":"F5MOV_sc3-f9xWcAOCC1Tg2"}],"PhoneNumber":"1-877-564-7397","Prefix":795,"Extension":4920,"ProductId":"_iFmgCPNtTuU1PlknnSqXQ2","ProductCode":"SAR","ProductDescription":"PATLive Messaging Executive","MailboxStatus":1,"BillingStatus":0,"MainMailbox":false,"InfoCode":0,"AliasId":"","FeatureGroupId":"hTw_mObs0ARWkbHxRXZyEw2","FeatureGroupDescription":"Hosted Voicemail/Fax","FeatureGroupIcon":"https://my.hostednumbers.com/images/services/SAR.jpg","ServiceName":"Hosted Voicemail/Fax","MailboxName":"Connor Grady 1","DID":true,"ExtensionDigits":0,"ParentMailboxId":"","NewMessages":4,"SavedMessages":2,"NewVoiceMessages":2,"SavedVoiceMessages":2,"NewFaxMessages":2,"SavedFaxMessages":0,"NewRecordings":0,"SavedRecordings":0},{"MailboxId":"vEqAb2JRNLrP1lB51FVkEw2","PhoneNumberList":[{"PhoneNumber":"1-850-523-3762","Description":"(850) 523-3762","Provisioned":true,"PhoneNumberId":"T-Ykotn8UNweSr4O0jHiqw2"},{"PhoneNumber":"1-888-330-3948","Description":"(888) 330-3948","Provisioned":true,"PhoneNumberId":"KK41mHIFEo5jD9DrzG8_Ig2"},{"PhoneNumber":"1-888-682-8469","Description":"(888) 682-8469","Provisioned":true,"PhoneNumberId":"svD01yJqBrZuJK-HzKvpcQ2"},{"PhoneNumber":"1-888-826-2674","Description":"(888) 826-2674","Provisioned":true,"PhoneNumberId":"zUfxFyXxKXtHB9nMdCs5lg2"},{"PhoneNumber":"1-888-853-4264","Description":"(888) 853-4264","Provisioned":true,"PhoneNumberId":"vmMwo_7x2hYxKa4gAc0PpQ2"},{"PhoneNumber":"1-888-856-2307","Description":"(888) 856-2307","Provisioned":true,"PhoneNumberId":"ViDGc7pJW25kkimk-ObguA2"},{"PhoneNumber":"1-888-856-2742","Description":"(888) 856-2742","Provisioned":true,"PhoneNumberId":"Wpt7fnGXoz8RxcP-xZkl9g2"},{"PhoneNumber":"1-888-858-8276","Description":"(888) 858-8276","Provisioned":true,"PhoneNumberId":"hB-cyJHU-w4BcCVcXmcIsw2"}],"PhoneNumber":"1-850-523-3762","Prefix":795,"Extension":4613,"ProductId":"mLVv-rU2-6GRboN46onbOg2","ProductCode":"CTS","ProductDescription":"Call Tracker Service","MailboxStatus":1,"BillingStatus":0,"MainMailbox":false,"InfoCode":0,"AliasId":"","FeatureGroupId":"v1uO_bCjMNSP9mF90AlO4w2","FeatureGroupDescription":"Hosted Local","FeatureGroupIcon":"https://my.hostednumbers.com/images/services/CTS.jpg","ServiceName":"Hosted Local","MailboxName":"Connor Grady 2","DID":true,"ExtensionDigits":0,"ParentMailboxId":"","NewMessages":0,"SavedMessages":0,"NewVoiceMessages":0,"SavedVoiceMessages":0,"NewFaxMessages":0,"SavedFaxMessages":0,"NewRecordings":0,"SavedRecordings":0}],"ErrorCode":0,"ErrorMessage":"","DataInfo":{"TotalResults":2,"TotalPages":1,"CurrentPage":1,"ResultsPerPage":20}}
2012-01-30 11:59:45.956 HostedNumbers[6909:5e0f] D restkit.network:RKObjectLoader.m:210 Found directly configured object mapping, creating temporary mapping provider for keyPath '%@'

--我的注销发生在此处,以下是我的第二个请求,其中包含用户名和密码,通常应返回身份验证质询 --

2012-01-30 11:59:57.678 HostedNumbers[6909:707] D restkit.network:RKClient.m:265 Reachability observer changed for client <RKClient: 0x6f14400>, suspending queue <RKRequestQueue: 0x6f145b0 name=(null) suspended=YES requestCount=0 loadingCount=0/5> until reachability to host '0.0.0.0' can be determined
2012-01-30 11:59:57.687 HostedNumbers[6909:707] D restkit.network:RKRequest.m:362 Sending asynchronous GET request to URL https://my.hostednumbers.com/api/v1.0/Mailbox/?format=json.
2012-01-30 11:59:57.691 HostedNumbers[6909:707] T restkit.network:RKRequest.m:310 Prepared GET URLRequest '<NSMutableURLRequest https://my.hostednumbers.com/api/v1.0/Mailbox/?format=json>'. HTTP Headers: {
    Accept = "application/json";
    "Content-Length" = 0;
}. HTTP Body: .
2012-01-30 11:59:57.698 HostedNumbers[6909:707] D restkit.network:RKClient.m:250 Reachability observer changed for RKClient <RKClient: 0x6f14400>, disposing of previous instance: <RKReachabilityObserver: 0x6f15cc0 host=0.0.0.0 isReachabilityDetermined=NO isMonitoringLocalWiFi=565500 reachabilityFlags=-- ------->
2012-01-30 12:00:00.012 HostedNumbers[6909:707] D restkit.network:RKResponse.m:163 Asked if canAuthenticateAgainstProtectionSpace: with authenticationMethod = NSURLAuthenticationMethodServerTrust
2012-01-30 12:00:02.076 HostedNumbers[6909:707] D restkit.network:RKResponse.m:196 NSHTTPURLResponse Status Code: 200
2012-01-30 12:00:02.082 HostedNumbers[6909:707] D restkit.network:RKResponse.m:197 Headers: {
    "Cache-Control" = "no-cache";
    "Content-Length" = 2733;
    "Content-Type" = "application/json; charset=utf-8";
    Date = "Mon, 30 Jan 2012 17:00:02 GMT";
    Expires = "-1";
    Pragma = "no-cache, no-cache";
    Server = "Microsoft-IIS/6.0";
    "X-AspNet-Version" = "2.0.50727";
    "X-Powered-By" = "ASP.NET";
}
2012-01-30 12:00:02.087 HostedNumbers[6909:707] T restkit.network:RKResponse.m:202 Read response body: {"Data":[{"MailboxId":"SP6s2m5zgwze47lsN5bBew2","PhoneNumberList":[{"PhoneNumber":"1-877-564-7397","Description":"(877) 564-7397","Provisioned":true,"PhoneNumberId":"F5MOV_sc3-f9xWcAOCC1Tg2"}],"PhoneNumber":"1-877-564-7397","Prefix":795,"Extension":4920,"ProductId":"_iFmgCPNtTuU1PlknnSqXQ2","ProductCode":"SAR","ProductDescription":"PATLive Messaging Executive","MailboxStatus":1,"BillingStatus":0,"MainMailbox":false,"InfoCode":0,"AliasId":"","FeatureGroupId":"hTw_mObs0ARWkbHxRXZyEw2","FeatureGroupDescription":"Hosted Voicemail/Fax","FeatureGroupIcon":"https://my.hostednumbers.com/images/services/SAR.jpg","ServiceName":"Hosted Voicemail/Fax","MailboxName":"Connor Grady 1","DID":true,"ExtensionDigits":0,"ParentMailboxId":"","NewMessages":4,"SavedMessages":2,"NewVoiceMessages":2,"SavedVoiceMessages":2,"NewFaxMessages":2,"SavedFaxMessages":0,"NewRecordings":0,"SavedRecordings":0},{"MailboxId":"vEqAb2JRNLrP1lB51FVkEw2","PhoneNumberList":[{"PhoneNumber":"1-850-523-3762","Description":"(850) 523-3762","Provisioned":true,"PhoneNumberId":"T-Ykotn8UNweSr4O0jHiqw2"},{"PhoneNumber":"1-888-330-3948","Description":"(888) 330-3948","Provisioned":true,"PhoneNumberId":"KK41mHIFEo5jD9DrzG8_Ig2"},{"PhoneNumber":"1-888-682-8469","Description":"(888) 682-8469","Provisioned":true,"PhoneNumberId":"svD01yJqBrZuJK-HzKvpcQ2"},{"PhoneNumber":"1-888-826-2674","Description":"(888) 826-2674","Provisioned":true,"PhoneNumberId":"zUfxFyXxKXtHB9nMdCs5lg2"},{"PhoneNumber":"1-888-853-4264","Description":"(888) 853-4264","Provisioned":true,"PhoneNumberId":"vmMwo_7x2hYxKa4gAc0PpQ2"},{"PhoneNumber":"1-888-856-2307","Description":"(888) 856-2307","Provisioned":true,"PhoneNumberId":"ViDGc7pJW25kkimk-ObguA2"},{"PhoneNumber":"1-888-856-2742","Description":"(888) 856-2742","Provisioned":true,"PhoneNumberId":"Wpt7fnGXoz8RxcP-xZkl9g2"},{"PhoneNumber":"1-888-858-8276","Description":"(888) 858-8276","Provisioned":true,"PhoneNumberId":"hB-cyJHU-w4BcCVcXmcIsw2"}],"PhoneNumber":"1-850-523-3762","Prefix":795,"Extension":4613,"ProductId":"mLVv-rU2-6GRboN46onbOg2","ProductCode":"CTS","ProductDescription":"Call Tracker Service","MailboxStatus":1,"BillingStatus":0,"MainMailbox":false,"InfoCode":0,"AliasId":"","FeatureGroupId":"v1uO_bCjMNSP9mF90AlO4w2","FeatureGroupDescription":"Hosted Local","FeatureGroupIcon":"https://my.hostednumbers.com/images/services/CTS.jpg","ServiceName":"Hosted Local","MailboxName":"Connor Grady 2","DID":true,"ExtensionDigits":0,"ParentMailboxId":"","NewMessages":0,"SavedMessages":0,"NewVoiceMessages":0,"SavedVoiceMessages":0,"NewFaxMessages":0,"SavedFaxMessages":0,"NewRecordings":0,"SavedRecordings":0}],"ErrorCode":0,"ErrorMessage":"","DataInfo":{"TotalResults":2,"TotalPages":1,"CurrentPage":1,"ResultsPerPage":20}}
2012-01-30 12:00:02.115 HostedNumbers[6909:3833] D restkit.network:RKObjectLoader.m:210 Found directly configured object mapping, creating temporary mapping provider for keyPath '%@'

I'm using the RestKit iOS package to allow a user to pull info from an account they have. The code below works perfectly the first time through. However, if I attempt to use a different username and password a second time, it just loads the information from the first mapping call. Furthermore, when the request is sent the second time, it returns the data unreasonably quickly which leads me to believe it is just using cached data. I've searched high and low for any way to reset restkit (and its cache) and none of them have worked. Here's my code:

- (void)login {
    RKObjectMapping* mapping = [RKObjectMapping mappingForClass:[MyClass class]];
    [mapping mapKeyPathsToAttributes:
     @"Data.MailboxId", @"MailboxId",
     @"Data.value1", @"Value1",
     @"Data.value2", @"Value2",
     nil];


    [RKObjectManager objectManagerWithBaseURL:@"https://my.site.com"];

    [RKObjectManager sharedManager].client.username = username.text;
    [RKObjectManager sharedManager].client.password = password.text;

    [[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"/api/v1.0/?format=json" objectMapping:mapping delegate:self];
}

And here's my log from RestKit:

2012-01-30 11:59:40.413 HostedNumbers[6909:707] D restkit.network:RKClient.m:265 Reachability observer changed for client <RKClient: 0x6f09640>, suspending queue <RKRequestQueue: 0x6f0a5d0 name=(null) suspended=YES requestCount=0 loadingCount=0/5> until reachability to host '0.0.0.0' can be determined
2012-01-30 11:59:40.425 HostedNumbers[6909:707] D restkit.network:RKClient.m:389 Reachability to host '0.0.0.0' determined for client <RKClient: 0x6f09640>, unsuspending queue <RKRequestQueue: 0x6f0a5d0 name=(null) suspended=YES requestCount=1 loadingCount=0/5>
2012-01-30 11:59:40.436 HostedNumbers[6909:707] D restkit.network:RKRequest.m:362 Sending asynchronous GET request to URL https://my.hostednumbers.com/api/v1.0/Mailbox/?format=json.
2012-01-30 11:59:40.445 HostedNumbers[6909:707] T restkit.network:RKRequest.m:310 Prepared GET URLRequest '<NSMutableURLRequest https://my.hostednumbers.com/api/v1.0/Mailbox/?format=json>'. HTTP Headers: {
    Accept = "application/json";
    "Content-Length" = 0;
}. HTTP Body: .
2012-01-30 11:59:43.045 HostedNumbers[6909:707] D restkit.network:RKResponse.m:163 Asked if canAuthenticateAgainstProtectionSpace: with authenticationMethod = NSURLAuthenticationMethodServerTrust
2012-01-30 11:59:43.513 HostedNumbers[6909:707] D restkit.network:RKResponse.m:163 Asked if canAuthenticateAgainstProtectionSpace: with authenticationMethod = NSURLAuthenticationMethodHTTPDigest
2012-01-30 11:59:43.516 HostedNumbers[6909:707] D restkit.network:RKResponse.m:137 Received authentication challenge
2012-01-30 11:59:44.066 HostedNumbers[6909:707] D restkit.network:RKResponse.m:163 Asked if canAuthenticateAgainstProtectionSpace: with authenticationMethod = NSURLAuthenticationMethodServerTrust
2012-01-30 11:59:45.914 HostedNumbers[6909:707] D restkit.network:RKResponse.m:196 NSHTTPURLResponse Status Code: 200
2012-01-30 11:59:45.917 HostedNumbers[6909:707] D restkit.network:RKResponse.m:197 Headers: {
    "Cache-Control" = "no-cache";
    "Content-Length" = 2733;
    "Content-Type" = "application/json; charset=utf-8";
    Date = "Mon, 30 Jan 2012 16:59:46 GMT";
    Expires = "-1";
    Pragma = "no-cache, no-cache";
    Server = "Microsoft-IIS/6.0";
    "X-AspNet-Version" = "2.0.50727";
    "X-Powered-By" = "ASP.NET";
}
2012-01-30 11:59:45.923 HostedNumbers[6909:707] T restkit.network:RKResponse.m:202 Read response body: {"Data":[{"MailboxId":"SP6s2m5zgwze47lsN5bBew2","PhoneNumberList":[{"PhoneNumber":"1-877-564-7397","Description":"(877) 564-7397","Provisioned":true,"PhoneNumberId":"F5MOV_sc3-f9xWcAOCC1Tg2"}],"PhoneNumber":"1-877-564-7397","Prefix":795,"Extension":4920,"ProductId":"_iFmgCPNtTuU1PlknnSqXQ2","ProductCode":"SAR","ProductDescription":"PATLive Messaging Executive","MailboxStatus":1,"BillingStatus":0,"MainMailbox":false,"InfoCode":0,"AliasId":"","FeatureGroupId":"hTw_mObs0ARWkbHxRXZyEw2","FeatureGroupDescription":"Hosted Voicemail/Fax","FeatureGroupIcon":"https://my.hostednumbers.com/images/services/SAR.jpg","ServiceName":"Hosted Voicemail/Fax","MailboxName":"Connor Grady 1","DID":true,"ExtensionDigits":0,"ParentMailboxId":"","NewMessages":4,"SavedMessages":2,"NewVoiceMessages":2,"SavedVoiceMessages":2,"NewFaxMessages":2,"SavedFaxMessages":0,"NewRecordings":0,"SavedRecordings":0},{"MailboxId":"vEqAb2JRNLrP1lB51FVkEw2","PhoneNumberList":[{"PhoneNumber":"1-850-523-3762","Description":"(850) 523-3762","Provisioned":true,"PhoneNumberId":"T-Ykotn8UNweSr4O0jHiqw2"},{"PhoneNumber":"1-888-330-3948","Description":"(888) 330-3948","Provisioned":true,"PhoneNumberId":"KK41mHIFEo5jD9DrzG8_Ig2"},{"PhoneNumber":"1-888-682-8469","Description":"(888) 682-8469","Provisioned":true,"PhoneNumberId":"svD01yJqBrZuJK-HzKvpcQ2"},{"PhoneNumber":"1-888-826-2674","Description":"(888) 826-2674","Provisioned":true,"PhoneNumberId":"zUfxFyXxKXtHB9nMdCs5lg2"},{"PhoneNumber":"1-888-853-4264","Description":"(888) 853-4264","Provisioned":true,"PhoneNumberId":"vmMwo_7x2hYxKa4gAc0PpQ2"},{"PhoneNumber":"1-888-856-2307","Description":"(888) 856-2307","Provisioned":true,"PhoneNumberId":"ViDGc7pJW25kkimk-ObguA2"},{"PhoneNumber":"1-888-856-2742","Description":"(888) 856-2742","Provisioned":true,"PhoneNumberId":"Wpt7fnGXoz8RxcP-xZkl9g2"},{"PhoneNumber":"1-888-858-8276","Description":"(888) 858-8276","Provisioned":true,"PhoneNumberId":"hB-cyJHU-w4BcCVcXmcIsw2"}],"PhoneNumber":"1-850-523-3762","Prefix":795,"Extension":4613,"ProductId":"mLVv-rU2-6GRboN46onbOg2","ProductCode":"CTS","ProductDescription":"Call Tracker Service","MailboxStatus":1,"BillingStatus":0,"MainMailbox":false,"InfoCode":0,"AliasId":"","FeatureGroupId":"v1uO_bCjMNSP9mF90AlO4w2","FeatureGroupDescription":"Hosted Local","FeatureGroupIcon":"https://my.hostednumbers.com/images/services/CTS.jpg","ServiceName":"Hosted Local","MailboxName":"Connor Grady 2","DID":true,"ExtensionDigits":0,"ParentMailboxId":"","NewMessages":0,"SavedMessages":0,"NewVoiceMessages":0,"SavedVoiceMessages":0,"NewFaxMessages":0,"SavedFaxMessages":0,"NewRecordings":0,"SavedRecordings":0}],"ErrorCode":0,"ErrorMessage":"","DataInfo":{"TotalResults":2,"TotalPages":1,"CurrentPage":1,"ResultsPerPage":20}}
2012-01-30 11:59:45.956 HostedNumbers[6909:5e0f] D restkit.network:RKObjectLoader.m:210 Found directly configured object mapping, creating temporary mapping provider for keyPath '%@'

--My sign out happens here, the following is my second request with a username and password that should normally return with an authentication challenge--

2012-01-30 11:59:57.678 HostedNumbers[6909:707] D restkit.network:RKClient.m:265 Reachability observer changed for client <RKClient: 0x6f14400>, suspending queue <RKRequestQueue: 0x6f145b0 name=(null) suspended=YES requestCount=0 loadingCount=0/5> until reachability to host '0.0.0.0' can be determined
2012-01-30 11:59:57.687 HostedNumbers[6909:707] D restkit.network:RKRequest.m:362 Sending asynchronous GET request to URL https://my.hostednumbers.com/api/v1.0/Mailbox/?format=json.
2012-01-30 11:59:57.691 HostedNumbers[6909:707] T restkit.network:RKRequest.m:310 Prepared GET URLRequest '<NSMutableURLRequest https://my.hostednumbers.com/api/v1.0/Mailbox/?format=json>'. HTTP Headers: {
    Accept = "application/json";
    "Content-Length" = 0;
}. HTTP Body: .
2012-01-30 11:59:57.698 HostedNumbers[6909:707] D restkit.network:RKClient.m:250 Reachability observer changed for RKClient <RKClient: 0x6f14400>, disposing of previous instance: <RKReachabilityObserver: 0x6f15cc0 host=0.0.0.0 isReachabilityDetermined=NO isMonitoringLocalWiFi=565500 reachabilityFlags=-- ------->
2012-01-30 12:00:00.012 HostedNumbers[6909:707] D restkit.network:RKResponse.m:163 Asked if canAuthenticateAgainstProtectionSpace: with authenticationMethod = NSURLAuthenticationMethodServerTrust
2012-01-30 12:00:02.076 HostedNumbers[6909:707] D restkit.network:RKResponse.m:196 NSHTTPURLResponse Status Code: 200
2012-01-30 12:00:02.082 HostedNumbers[6909:707] D restkit.network:RKResponse.m:197 Headers: {
    "Cache-Control" = "no-cache";
    "Content-Length" = 2733;
    "Content-Type" = "application/json; charset=utf-8";
    Date = "Mon, 30 Jan 2012 17:00:02 GMT";
    Expires = "-1";
    Pragma = "no-cache, no-cache";
    Server = "Microsoft-IIS/6.0";
    "X-AspNet-Version" = "2.0.50727";
    "X-Powered-By" = "ASP.NET";
}
2012-01-30 12:00:02.087 HostedNumbers[6909:707] T restkit.network:RKResponse.m:202 Read response body: {"Data":[{"MailboxId":"SP6s2m5zgwze47lsN5bBew2","PhoneNumberList":[{"PhoneNumber":"1-877-564-7397","Description":"(877) 564-7397","Provisioned":true,"PhoneNumberId":"F5MOV_sc3-f9xWcAOCC1Tg2"}],"PhoneNumber":"1-877-564-7397","Prefix":795,"Extension":4920,"ProductId":"_iFmgCPNtTuU1PlknnSqXQ2","ProductCode":"SAR","ProductDescription":"PATLive Messaging Executive","MailboxStatus":1,"BillingStatus":0,"MainMailbox":false,"InfoCode":0,"AliasId":"","FeatureGroupId":"hTw_mObs0ARWkbHxRXZyEw2","FeatureGroupDescription":"Hosted Voicemail/Fax","FeatureGroupIcon":"https://my.hostednumbers.com/images/services/SAR.jpg","ServiceName":"Hosted Voicemail/Fax","MailboxName":"Connor Grady 1","DID":true,"ExtensionDigits":0,"ParentMailboxId":"","NewMessages":4,"SavedMessages":2,"NewVoiceMessages":2,"SavedVoiceMessages":2,"NewFaxMessages":2,"SavedFaxMessages":0,"NewRecordings":0,"SavedRecordings":0},{"MailboxId":"vEqAb2JRNLrP1lB51FVkEw2","PhoneNumberList":[{"PhoneNumber":"1-850-523-3762","Description":"(850) 523-3762","Provisioned":true,"PhoneNumberId":"T-Ykotn8UNweSr4O0jHiqw2"},{"PhoneNumber":"1-888-330-3948","Description":"(888) 330-3948","Provisioned":true,"PhoneNumberId":"KK41mHIFEo5jD9DrzG8_Ig2"},{"PhoneNumber":"1-888-682-8469","Description":"(888) 682-8469","Provisioned":true,"PhoneNumberId":"svD01yJqBrZuJK-HzKvpcQ2"},{"PhoneNumber":"1-888-826-2674","Description":"(888) 826-2674","Provisioned":true,"PhoneNumberId":"zUfxFyXxKXtHB9nMdCs5lg2"},{"PhoneNumber":"1-888-853-4264","Description":"(888) 853-4264","Provisioned":true,"PhoneNumberId":"vmMwo_7x2hYxKa4gAc0PpQ2"},{"PhoneNumber":"1-888-856-2307","Description":"(888) 856-2307","Provisioned":true,"PhoneNumberId":"ViDGc7pJW25kkimk-ObguA2"},{"PhoneNumber":"1-888-856-2742","Description":"(888) 856-2742","Provisioned":true,"PhoneNumberId":"Wpt7fnGXoz8RxcP-xZkl9g2"},{"PhoneNumber":"1-888-858-8276","Description":"(888) 858-8276","Provisioned":true,"PhoneNumberId":"hB-cyJHU-w4BcCVcXmcIsw2"}],"PhoneNumber":"1-850-523-3762","Prefix":795,"Extension":4613,"ProductId":"mLVv-rU2-6GRboN46onbOg2","ProductCode":"CTS","ProductDescription":"Call Tracker Service","MailboxStatus":1,"BillingStatus":0,"MainMailbox":false,"InfoCode":0,"AliasId":"","FeatureGroupId":"v1uO_bCjMNSP9mF90AlO4w2","FeatureGroupDescription":"Hosted Local","FeatureGroupIcon":"https://my.hostednumbers.com/images/services/CTS.jpg","ServiceName":"Hosted Local","MailboxName":"Connor Grady 2","DID":true,"ExtensionDigits":0,"ParentMailboxId":"","NewMessages":0,"SavedMessages":0,"NewVoiceMessages":0,"SavedVoiceMessages":0,"NewFaxMessages":0,"SavedFaxMessages":0,"NewRecordings":0,"SavedRecordings":0}],"ErrorCode":0,"ErrorMessage":"","DataInfo":{"TotalResults":2,"TotalPages":1,"CurrentPage":1,"ResultsPerPage":20}}
2012-01-30 12:00:02.115 HostedNumbers[6909:3833] D restkit.network:RKObjectLoader.m:210 Found directly configured object mapping, creating temporary mapping provider for keyPath '%@'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

装迷糊 2025-01-08 02:52:04

答案出奇的简单。我刚刚将以下代码行添加到我的请求中以强制基本 HTTP 身份验证,并且一切正常:

[RKObjectManager sharedManager].client.authenticationType = RKRequestAuthenticationTypeHTTPBasic;

The answer was surprisingly simple. I just added the following line of code to my request to force basic HTTP authentication and it all works:

[RKObjectManager sharedManager].client.authenticationType = RKRequestAuthenticationTypeHTTPBasic;
笑红尘 2025-01-08 02:52:04

您是否尝试过更改缓存策略?

RKClient* client = [RKClient clientWithBaseURL:APP_URL];
client.cachePolicy = RKRequestCachePolicyNone;

尝试一下,看看这是否可以解决您的问题(暂时)。

have you tried changing the cache policy ?

f.e.

RKClient* client = [RKClient clientWithBaseURL:APP_URL];
client.cachePolicy = RKRequestCachePolicyNone;

try it and see if this fixes your problem (temporarily).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文