[Issue #1366] Adding shouldUseCredentialStorage and credential properties to AFHTTPRequestOperationManager

This commit is contained in:
Mattt Thompson 2013-09-26 07:16:37 -07:00
parent 09658b352a
commit d0b4f72d83
2 changed files with 20 additions and 0 deletions

View File

@ -108,6 +108,24 @@
*/
@property (nonatomic, strong) NSOperationQueue *operationQueue;
///-------------------------------
/// @name Managing URL Credentials
///-------------------------------
/**
Whether request operations should consult the credential storage for authenticating the connection. `YES` by default.
@see AFURLConnectionOperation -shouldUseCredentialStorage
*/
@property (nonatomic, assign) BOOL shouldUseCredentialStorage;
/**
The credential used by request operations for authentication challenges.
@see AFURLConnectionOperation -credential
*/
@property (nonatomic, strong) NSURLCredential *credential;
///-------------------------------
/// @name Managing Security Policy
///-------------------------------

View File

@ -101,6 +101,8 @@
{
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
operation.responseSerializer = self.responseSerializer;
operation.shouldUseCredentialStorage = self.shouldUseCredentialStorage;
operation.credential = self.credential;
operation.securityPolicy = self.securityPolicy;
[operation setCompletionBlockWithSuccess:success failure:failure];