- Download BANetworking and try out the included Mac and iPhone example apps
- Check out the documentation for a comprehensive look at all of the APIs available in BANetworking
BANetworking uses ARC and is based on NSURLSession, which means it supports iOS 7.0 and above and Mac OS X 10.9 and above.
If you need a hand, you can contact us by e-mail.
[BANetworking setDebugEnabled:YES];
BARequest *request = [BARequest GETRequestWithURL:[NSURL URLWithString:@"http://127.0.0.1/avatar"] parameters:nil];
[[[[BAClient currentClient] performRequest:request] onComplete:^(BAResponse *result, NSError *error) {
}] onProgress:^(float progress) {
NSLog(@"download progress = %f",progress);
}];
BARequest *request = [BARequest POSTRequestWithPath:path parameters:nil];
request.contentType = BARequestContentTypeMultipart;
request.fileData = [BARequestFileData fileDataWithData:data name:fileName fileName:[NSString stringWithFormat:@“%@.png",fileName]];
[[[BAClient currentClient] performRequest:request] onComplete:^(id result, NSError *error) {
if (error) {
NSLog(@"file upload error");
} else {
NSLog(@"file upload succeed");
}
}];
If you are using CocoaPods, then, just add this line to your Podfile
pod 'BANetworking', '~> 1.0.1'
You can find a getting started guide and full documentation over at the BANetworking.
BANetworking is released under the MIT license.