diff --git a/AFNetworking/AFRestClient.h b/AFNetworking/AFRestClient.h index 28f8f21..b171815 100644 --- a/AFNetworking/AFRestClient.h +++ b/AFNetworking/AFRestClient.h @@ -44,6 +44,8 @@ - (NSMutableURLRequest *)requestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters; +- (void)enqueueHTTPOperation:(AFHTTPRequestOperation *)operation; + - (void)enqueueHTTPOperationWithRequest:(NSURLRequest *)request success:(void (^)(id response))success failure:(void (^)(NSError *error))failure; diff --git a/AFNetworking/AFRestClient.m b/AFNetworking/AFRestClient.m index b382e0c..cd128fb 100644 --- a/AFNetworking/AFRestClient.m +++ b/AFNetworking/AFRestClient.m @@ -128,13 +128,17 @@ static NSStringEncoding const kAFRestClientStringEncoding = NSUTF8StringEncoding return request; } +- (void)enqueueHTTPOperation:(AFHTTPRequestOperation *)operation { + [self.operationQueue addOperation:operation]; +} + - (void)enqueueHTTPOperationWithRequest:(NSURLRequest *)request success:(void (^)(id response))success failure:(void (^)(NSError *error))failure { if ([request URL] == nil || [[request URL] isEqual:[NSNull null]]) { return; } AFHTTPRequestOperation *operation = [AFJSONRequestOperation operationWithRequest:request success:success failure:failure]; - [self.operationQueue addOperation:operation]; + [self enqueueHTTPOperation:operation]; } - (void)cancelHTTPOperationsWithRequest:(NSURLRequest *)request {