Skip to content
This repository has been archived by the owner on Nov 13, 2017. It is now read-only.
/ MBTNetworking Public archive

☎️ A simple networking library for iOS based on AFNetworking 2, Mantle and PromiseKit.

License

Notifications You must be signed in to change notification settings

m4tbat/MBTNetworking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MBTNetworking

Version License Platform

Usage

Here's an excerpt from the super-minimal example project which demonstrates instantiating the manager pointing to http://httpbin.org, performing two sequential requests to get some data, and consuming the parsed response objects:

MBTNetworkManager *manager = [[MBTNetworkManager alloc] initWithBaseURL:[NSURL URLWithString:@"http://httpbin.org"]];

[manager performRequest:[MBTSampleRequests get]].then(^(MBTHTTPBinGetModel *getModel, NSURLSessionTask *task) {
    NSLog(@"Origin: %@", getModel.origin);
    NSLog(@"User-Agent: %@", getModel.headers.userAgent);

    return [manager performRequest:[MBTSampleRequests headers]];
}).then(^(MBTHTTPBinHeadersModel *headersModel, NSURLSessionTask *task) {
    NSLog(@"Headers: %@", headersModel);
}).catch(^(NSError *error) {
    NSLog(@"Error: %@", error);
});

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

Requirements

MBTNetworking requires iOS 7.0+

Installation

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

pod "MBTNetworking"

Author

Matteo Battaglio, http://twitter.com/@m4dbat

License

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

About

☎️ A simple networking library for iOS based on AFNetworking 2, Mantle and PromiseKit.

Resources

License

Stars

Watchers

Forks

Packages

No packages published