0
现在我正在使用AFNetworking 2.0
,我想将它迁移到AFNetworking 3.0
。我已经将文件添加到项目中,它显示了很多错误。我检查了migration guide。我的疑问是如何将NSURLCredential
设置为AFNetworking 3.0.4
中的登录请求url。我现在用的,AFNetworking 3.0迁移
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
if ([url rangeOfString:NSLoginUrl].location != NSNotFound)
{
NSURLCredential *credential = [NSURLCredential credentialWithUser:@"userName" password:@"password" persistence:NSURLCredentialPersistenceNone];
[operation setCredential:credential];
}
但AFNetworking 3
不支持AFHTTPRequestOperation
和 AFHTTPRequestOperationManager
。请帮帮我。