From 73f994472ffcfdfa14afe137b4b3aafbe9ef1dd5 Mon Sep 17 00:00:00 2001 From: Mattt Thompson Date: Sun, 14 Oct 2012 10:22:40 -0700 Subject: [PATCH] Using consistent urlRequest parameter name in AFHTTPClient --- AFNetworking/AFHTTPClient.h | 8 ++++---- AFNetworking/AFHTTPClient.m | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/AFNetworking/AFHTTPClient.h b/AFNetworking/AFHTTPClient.h index bb631c5..4bf9662 100755 --- a/AFNetworking/AFHTTPClient.h +++ b/AFNetworking/AFHTTPClient.h @@ -277,11 +277,11 @@ typedef enum { In order to determine what kind of operation is created, each registered subclass conforming to the `AFHTTPClient` protocol is consulted (in reverse order of when they were specified) to see if it can handle the specific request. The first class to return `YES` when sent a `canProcessRequest:` message is used to generate an operation using `HTTPRequestOperationWithRequest:success:failure:`. - @param request The request object to be loaded asynchronously during execution of the operation. + @param urlRequest The request object to be loaded asynchronously during execution of the operation. @param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the created request operation and the object created from the response data of request. @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes two arguments:, the created request operation and the `NSError` object describing the network or parsing error that occurred. */ -- (AFHTTPRequestOperation *)HTTPRequestOperationWithRequest:(NSURLRequest *)request +- (AFHTTPRequestOperation *)HTTPRequestOperationWithRequest:(NSURLRequest *)urlRequest success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure; @@ -313,13 +313,13 @@ typedef enum { /** Creates and enqueues an `AFHTTPRequestOperation` to the HTTP client's operation queue for each specified request object into a batch. When each request operation finishes, the specified progress block is executed, until all of the request operations have finished, at which point the completion block also executes. - @param requests The `NSURLRequest` objects used to create and enqueue operations. + @param urlRequests The `NSURLRequest` objects used to create and enqueue operations. @param progressBlock A block object to be executed upon the completion of each request operation in the batch. This block has no return value and takes two arguments: the number of operations that have already finished execution, and the total number of operations. @param completionBlock A block object to be executed upon the completion of all of the request operations in the batch. This block has no return value and takes a single argument: the batched request operations. @discussion Operations are created by passing the specified `NSURLRequest` objects in `requests`, using `-HTTPRequestOperationWithRequest:success:failure:`, with `nil` for both the `success` and `failure` parameters. */ -- (void)enqueueBatchOfHTTPRequestOperationsWithRequests:(NSArray *)requests +- (void)enqueueBatchOfHTTPRequestOperationsWithRequests:(NSArray *)urlRequests progressBlock:(void (^)(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations))progressBlock completionBlock:(void (^)(NSArray *operations))completionBlock; diff --git a/AFNetworking/AFHTTPClient.m b/AFNetworking/AFHTTPClient.m index a84c525..4852223 100755 --- a/AFNetworking/AFHTTPClient.m +++ b/AFNetworking/AFHTTPClient.m @@ -184,7 +184,7 @@ static NSString * AFPropertyListStringFromParameters(NSDictionary *parameters) { } @interface AFStreamingMultipartFormData : NSObject -- (id)initWithURLRequest:(NSMutableURLRequest *)request +- (id)initWithURLRequest:(NSMutableURLRequest *)urlRequest stringEncoding:(NSStringEncoding)encoding; - (NSMutableURLRequest *)requestByFinalizingMultipartFormData; @@ -541,12 +541,12 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {} } } -- (void)enqueueBatchOfHTTPRequestOperationsWithRequests:(NSArray *)requests +- (void)enqueueBatchOfHTTPRequestOperationsWithRequests:(NSArray *)urlRequests progressBlock:(void (^)(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations))progressBlock completionBlock:(void (^)(NSArray *operations))completionBlock { NSMutableArray *mutableOperations = [NSMutableArray array]; - for (NSURLRequest *request in requests) { + for (NSURLRequest *request in urlRequests) { AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithRequest:request success:nil failure:nil]; [mutableOperations addObject:operation]; } @@ -768,7 +768,7 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2; @synthesize bodyStream = _bodyStream; @synthesize stringEncoding = _stringEncoding; -- (id)initWithURLRequest:(NSMutableURLRequest *)request +- (id)initWithURLRequest:(NSMutableURLRequest *)urlRequest stringEncoding:(NSStringEncoding)encoding { self = [super init]; @@ -776,7 +776,7 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2; return nil; } - self.request = request; + self.request = urlRequest; self.stringEncoding = encoding; self.bodyStream = [[AFMultipartBodyStream alloc] initWithStringEncoding:encoding];