Skip to content

Foreverland/NSURLSessionTask-ANDYOffline

Repository files navigation

[WIP] — NSURLSessionTask-ANDYOffline

CI Status

Offline support for HTTP requests (POST/PUT/PATCH/DELETE). If the request fails, times out or if you're offline you can save the task on disk and reproduce it later.

How it works

Saving failed requests:

[task saveWithParams:params];
[manager POST:path
   parameters:params
      success:^(NSURLSessionDataTask *task, id responseObject) {

          // everything went well, be happy

      } failure:^(NSURLSessionDataTask *task, NSError *error) {

          [task saveWithParams:params];

      }];

Retrieving offline requests:

NSArray *offlineTasks = [NSURLSessionTask offlineTasks];

Removing offline requests:

[task remove];

Replaying offline requests (needs a NSURLSession or a AFHTTPSessionManager):

[manager replay];

Author

Elvis Nuñez, elvisnunez@me.com

License

NSURLSessionTask-ANDYOffline is available under the MIT license. See the LICENSE file for more info.

About

Offline support for HTTP requests (POST/PUT/PATCH/DELETE)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages