简体   繁体   English

从RestKit 0.10更新到0.20

[英]Update from RestKit 0.10 to 0.20

I'm actually updating my project from ResKit 0.10 to 0.20 and I have an issue. 我实际上正在将我的项目从ResKit 0.10更新到0.20,但是我遇到了问题。 In our web service we use Windows Authentication and SSL and if we activate both of them ,RestKit 0.20 is unable to connect. 在我们的Web服务中,我们使用Windows身份验证和SSL,如果我们同时激活它们,则RestKit 0.20无法连接。 We didn't have problems with RestKit 0.10 but with 0.20 we need to desactivate one of them (Windows authentication or SSL) to make it work. RestKit 0.10并没有问题,但是0.20时,我们需要停用其中之一(Windows身份验证或SSL)以使其正常工作。

I already tried those methods and they didn't work: 我已经尝试过这些方法,但是它们没有用:

[[RKObjectManager sharedManager].HTTPClient setAuthorizationHeaderWithUsername:API_USERNAME password:API_PASSWORD];

[[RKObjectManager sharedManager].HTTPClient setDefaultCredential:[NSURLCredential credentialWithUser:API_USERNAME password:API_PASSWORD persistence:NSURLCredentialPersistenceForSession]];

Is it possible to use RestKit 0.20 with SSL and Windows Authentication? 是否可以将RestKit 0.20与SSL和Windows身份验证一起使用? If it's possible, what can I do to make it work. 如果有可能,我该怎么做才能使其正常工作。

Thank you so much for your help 非常感谢你的帮助

Your code looks about right. 您的代码看起来正确。 There have been som bugs in this area. 在这方面有一些臭虫。 Check that you are using the most up to date version of 0.2x (you might actually want to use the current dev branch if you can till it gets pushed to master). 检查您使用的是最新版本的0.2x(如果可以直到将其推送到主版本,则实际上可能要使用当前的dev分支)。

If you do need to workaround, you can use appropriateObjectRequestOperationWithObject:method:path:parameters: to a full operation or you can take the request from requestWithMethod:path:parameters: and feed it into objectRequestOperationWithRequest:success:failure: . 如果确实需要解决方法,则可以使用appropriateObjectRequestOperationWithObject:method:path:parameters: requestWithMethod:path:parameters: appropriateObjectRequestOperationWithObject:method:path:parameters:进行完整操作,也可以从requestWithMethod:path:parameters:获取请求, requestWithMethod:path:parameters:其输入objectRequestOperationWithRequest:success:failure:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM