###FGNetwork
……………………………………………………..
##Introduction
A light networking kit for iOS with GET ,POST,file upload and multi files uploading supported,base on NSURLSession
.
##Installtion
Manual:
Download This Project and drag the FGNetwork folder into your peroject, do not forget to ensure “copy item if need” being selected.
##Usage
Just import the header file:import "FGNetwork.h"
Singleton
1 | /** |
GET:
1 | /** |
POST:
1 | /** |
And file upload supported:
1 | /** |
Multi files upload supported:
1 | /**上传多张照片(2张)file应该对应多个变量名儒file0,file1*/ |
And a optional function:
1 | /** |
##Example1
2
3
4
5
6
7
8
9
10
11-(void)downloadData{
[[FGNetwork shared] get:@"http://www.baidu.com" success:^(NSData *data, NSURLResponse *response) {
NSString *str=[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"%@",str);
} failure:^(NSError *error) {
}];
}
##About Me
Blog: CGPointZeero
GitHub: Insfgg99x
Mooc: CGPointZero
Jianshu: CGPointZero
Email: newbox0512@yahoo.com
I attached my code on github,touch to download ->FGNetwork
……………………………………………………..
@CGPoitZero