XBCacheRequest 0.7.3

XBCacheRequest 0.7.3

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jan 2016

Maintained by Eugene Nguyen.



 
Depends on:
AFNetworking>= 0
JSONKit-NoWarning>= 0
MBProgressHUD>= 0
 

  • By
  • eugenenguyen

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

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

pod "XBCacheRequest"

Getting Started

1. Import the most important header

#import <XBCacheRequest.h>

2. Start your request

XBCacheRequest *request = XBCacheRequest(@"http://123.com/abc");
[request setDataPost:[@{@"foo": @"bar",
@"veryfoor": @"bartoo"} mutableCopy]];
[request startAsynchronousWithCallback:^(XBCacheRequest *request, NSString *result, BOOL fromCache, NSError *error) {
if (error)
{
// handle error
}
else
{
// handle response
}
}];

3. You can also disable cache system by adding

request.disableCache = YES;

4. And can set default host for the whole project just by

[[XBCacheRequestManager sharedInstance] setHost:@"http://example.com"];
// and normally user request without host
XBCacheRequest *request = XBCacheRequest(@"abc");
// but even can work with another host
XBCacheRequest *request = XBCacheRequest(@"http://123.com/abc");

Author

eugenenguyen, [email protected]

License

XBCacheRequest is available under the MIT license. See the LICENSE file for more info.