coderjackyhuang / hybnetworking Goto Github PK
View Code? Open in Web Editor NEW基于AFNetworking3.0以上版本封装的网络层。提供常用的GET/POST接口、上传下载图片、文件接口、支持缓存等。
License: MIT License
基于AFNetworking3.0以上版本封装的网络层。提供常用的GET/POST接口、上传下载图片、文件接口、支持缓存等。
License: MIT License
能不能支持https自签名证书?有提供这样的接口么?
可以支持cookie吗?急救啊。
还有就是客户端要用这个 返回的状态码去判断用户在线状态。然后做操作。这块写那个方法最好?+ (void)logWithFailError:(NSError *)error url:(NSString *)url params:(id)params ? 还是+ (void)handleCallbackWithError:(NSError *)error fail:(XMResponseFail)fail ?
不带一些缓存之类的吗?
怎么不把依赖的AFNetworking用到最新的3.1.0呢
升级Xcode8和iOS10之后,打印的数据不全,只显示一部分。大神,不管了吗
文章讲解的链接点击后,出现“建立数据库连接时出错”!
使用最新HYBNetworking版本 post提交数据到服务器,服务端取不到参数
用原生的请求正常 可以获得参数
下载zip包,8p没问题.x系列的缺失zip包里面的index.html
1.在进行Post或者Get请求时,在原有的+ (AFHTTPSessionManager *)manager进行创建时,参数传不到服务器,但是用原生的AFHTTPSessionManager创建就可以将参数传过去
2.难道大家在使用的时候都没有发现?感觉好郁闷啊...
不支持断点续传么?
@CoderJackyHuang
hi, i want ask some question about streaming upload, this is the problem for me.
the method you provide still need transfer image to nsdata, how about my file is big enough to make app crash.
our app is support iOS 7, and support video upload, when you file is big enough, the app will crash.
thanks.
为什么上传文件接口中uploadingFile参数转换成NSURL类型不是用[NSURL fileURLWithPath:uploadingFile]而是用[NSURL URLWithString:uploadingFile]?
最近遇到的问题是,网络请求失败后返回的错误信息: error.localizedDescription 为 “已取消”,这个问题是否为在error.code == NSURLErrorCancelled时造成的?
我们本地适配的错误类型 提示语没有这个信息
大概的思路如下:
接口缓存超时时间:kAPICacheTimeOut
第一次请求用户详情接口的时间戳:timestampA
第二次请求用户详情接口的时间戳:timestampB
timestampA-timestampB<= kAPICacheTimeOut,则直接获取本地缓存数据;
timestampA-timestampB> kAPICacheTimeOut,则直接获取网络数据;
*注:每次请求接口都将请求的时间戳缓存在本地
请问网络请求数据,只对NSData数据,其他数据在底层怎么判断?如果不判断,可能服务返回的都是异常的,例如是nsstring类型,如果发现是多了或者少了一个},都没有判断。
标哥可以增加mdprogresshud或svprogresshud,整合hud和网络请求之间的状态
我发现你封装的api目前只有上传单张图片,如果传多张图是循环调用那个接口吗?还是传个数组然后循环调用appenddata方法就好?
换成AFHTTPSessionManager 就没问题
在+ (void)updateBaseUrl:(NSString *)baseUrl {
if ([baseUrl isEqualToString:sg_privateNetworkBaseUrl] && baseUrl && baseUrl.length) {
sg_isBaseURLChanged = YES;
} else {
sg_isBaseURLChanged = NO;
}
sg_privateNetworkBaseUrl = baseUrl;
}
这里第一个判断条件 [baseUrl isEqualToString:sg_privateNetworkBaseUrl] 是否应该添加非操作,只有新的baseURL与原来的baseURL不一样的时候,才可以证明baseURLchanged,请问是这样吗?
目前怎么处理网络请求并发问题? 单例和加锁处理不了并发请求,处理多网络请求效率很低呀.
大神,我现在项目用到你的这个进行数据请求的,项目需要考虑304进行缓存,能给点建议吗
2.0版本的podspec文件没有修改
pod install 安装的还是1.1.3
sg_httpHeaders 被定义成static 没有办法把token加入进去,导致请求一直不成功,博主可否 开放 sg_httpHeaders 或 sg_sharedManager 权限吗? 谢谢~
get方式缓存存进去了,怎么读取不到
HYBNetworking.m line 500 (+ (NSString *)hyb_URLEncode:(NSString *)url )
【CFStringRef CFURLCreateStringByAddingPercentEscapes(CFAllocatorRef allocator, CFStringRef originalString, CFStringRef charactersToLeaveUnescaped, CFStringRef legalURLCharactersToBeEscaped, CFStringEncoding encoding) CF_DEPRECATED(10_0, 10_11, 2_0, 9_0, "Use [NSString stringByAddingPercentEncodingWithAllowedCharacters:] instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent (since each URL component or subcomponent has different rules for what characters are valid).");】
在使用的过程中发现多有关于网络请求的都会照成内存泄露 怎么解决呢
目前项目都是采用restful风格, 如果能加入 put delete 就相当完美了 适用性更广了
期待您的解答
可以缓存数据就更好了
我测试过你写的demo 里面有很多内存泄漏
.m 47行, 默认是kHYBRequestTypePlainText
可以加上超时设置
目前好像只支持单图上传啊,如果使用for循环多图上传,那么上传进度就会有问题
获取图片验证码的接口,返回的是data. 调用这个库提示error,返回 errorInfos:Request failed: unacceptable content-type: image/png
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.