Skip to content

Latest commit

 

History

History
executable file
·
43 lines (28 loc) · 2.07 KB

File metadata and controls

executable file
·
43 lines (28 loc) · 2.07 KB

AFHTTPSessionManager-AFUniqueGET

CI Status Version License Platform

Your GET request is in progress, then you make a new request asking for the same resource, better reuse it than creating a new one, right?

This category adds the uniqueGET method to AFHTTPSessionManager, which is useful if you want to avoid making multiple calls at the same resource if the operation is still in progress.

A common request between AFNetworking users (for example #499 and #1460).

We achieve this by checking ongoing operations before creating new ones.

Usage

Installation

AFHTTPSessionManager-AFUniqueGET is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'AFHTTPSessionManager-AFUniqueGET'

API

- (void)uniqueGET:(NSString *)URLString
       parameters:(id)parameters
             task:(void (^)(NSURLSessionDataTask *task, BOOL existing))task
          success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
          failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;

Author

Elvis Nuñez, hello@nselvis.com

License

AFHTTPSessionManager-AFUniqueGET is available under the MIT license. See the LICENSE file for more info.