CDNetworkHelper 1.0.9

CDNetworkHelper 1.0.9

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最新发布2017年3月

[email protected]维护。



 
依赖
AFNetworking>= 0
YYCache>= 0
 

  • 1617176084

安装

1.手动安装

下载DEMO后,将子文件夹CDNetworkHelper拖入项目,导入头文件CDNetworkHelper.h开始使用

用法

** 关注所有请求失败的回调

[CDNetworkHelper requestAllFailure:^(NSError *error) {
    NSLog(@"requestAllFailure");
}];

** 关注所有请求成功的回调

[CDNetworkHelper requestAllSuccess:^(id responseObject) {
    NSLog(@"requestAllSuccess");
}];

[CDNetworkHelper GET:@"http://gc.ditu.aliyun.com/regeocoding?l=39.938133,116.395739&type=001" parameters:NULL success:^(id responseObject) {
  NSLog(@"responseObject %@",responseObject);
} failure:^(NSError *error) {
  NSLog(@"error %@",error);
}];

** 关闭URL请求时的UTF_8编码规则处理

//注意:  如网址含有不符合URL编码规则的地址会崩溃
// [CDNetworkHelper closeLogUriUTF_8Format];

[CDNetworkHelper GET:@"http://gc.ditu.aliyun.com/geocoding?a=苏州市" parameters:NULL success:^(id responseObject) {
    NSLog(@"responseObject %@",responseObject);
} failure:^(NSError *error) {
    NSLog(@"error %@",error);
}];