mqzhot / daisynet Goto Github PK
View Code? Open in Web Editor NEWAlamofire与Cache封装 , 更容易存储请求数据
License: MIT License
Alamofire与Cache封装 , 更容易存储请求数据
License: MIT License
刚刚学习Swift,很多语法还不是很明白,不知道楼主这个框架在发起请求的时候是如何区分请求类型的。
刚刚用pod 'Alamofire', '~> 5.0.0-rc.2',和cache的5.2.0配合使用,一堆报错,还有就是cache包报了一个Command CompileSwift failed with a nonzero exit code,不知道怎么解决了
请问如何判断缓存数据和请求数据一致?如果服务端请求数据和缓存数据不一致,如何处理的呢?
If i use
DaisyNet.downloadCancel(source);
and immediately check for its status by
DaisyNet.downloadStatus(source)
it shows DownloadStatus.downloading
DaisyNet.timeoutIntervalForRequest(5)
无效。
pod 'DaisyNet' 时,无法调用download
今天在网络请求当中 我发现用框架的responseCacheAndString返回了乱码{"msg":"ç�»å½�æ��å��"} 估计是Alamofire本身的问题,我发现你在用相应string返回的时候 直接返回了reslut 没有做任何处理 不知道是不是这个原因 因为缓存显示 就是正确的。希望能改进下
如果参数使用JsonString,并且要放在Body中,该如何使用?
DaisyNet.request请求总报DaisyValue(isCacheData: false, result: SUCCESS: { error = "Invalid API key!"; }用插件测的接口是通着的,没找到原因
let resumeData = getResumeData(key) 一直是空的
How do i change the file name in which the downloaded file will be written?
as of now i can see you are using response.suggestedFilename ?? ""
for name. It would be great if that can be overridden manually
麻烦适配一下最新的Alamofire版本
使用DaisyNet.downloadFilePath(url)查看路径是空的,url没带有后缀。如.png .mp4等 https://192.168.0.0/app/er/file/getFile这就是url。望回复
请问作者还有打算更新此库的打算吗?目前最新版本不能用了
比如demo里面的params
let params = ["keyword" : "", "npc" : "0", "opc" : "20", "type" : "热门视频", "uid" : "2321"]
第一次启动的时候打印 params = ["uid": "2321", "opc": "20", "type": "热门视频", "keyword": "", "npc": "0"]
杀死程序重新启动打印 params = ["uid": "2321", "npc": "0", "keyword": "", "opc": "20", "type": "热门视频"]
所以每次缓存的key都不一样
Extension of type 'KeyChange' with constraints cannot have an inheritance clause
如
下载参数fileName必须指定文件后缀名,这里如何支持多种类型的,而不是写死的呢
你好,请求参数能放body里面吗,没找到对应的方法
好像无法进入到.response的回调里面呢
Use of unresolved identifier 'DaisyNet 是要怎么导入呢, 放自己项目报错
目前是通过cacheExpiryConfig全局设置缓存过期时间,这样有个问题,如果两个request的缓存过期时间不同,第一个request请求完成前设置了第二个request的缓存过期时间,那第一个request的缓存过期时间就和第二个的一样了
是否服务器需要配置缓存机制?iOS端访问出现获取缓存失败
过期时间设置好像没有作用,设置了以后缓存依然存在的
func cacheKey(_ url: String, _ params: Dictionary<String, Any>?, _ dynamicParams: Dictionary<String, Any>?) -> String {
/// c参数重复, params
中过滤掉dynamicParams
中的参数
if let filterParams = params?.filter({ (key, _) -> Bool in
return dynamicParams?.contains(where: { (key1, _) -> Bool in
return key != key1
}) ?? false
}) {
let str = "(url)" + "(sort(filterParams))"
return MD5(str)
} else {
return MD5(url)
}
}
contains方法命中就会停止本次循环,不能使用!=
我存的音频,然后每次构建完后,再次打开音频播放就会出现错误
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.