{"id":23422689,"url":"https://github.com/arc-lin/alnetworking","last_synced_at":"2025-07-08T22:04:04.645Z","repository":{"id":52505552,"uuid":"93944279","full_name":"Arc-lin/ALNetworking","owner":"Arc-lin","description":"A networking framework , depends on AFNetworking","archived":false,"fork":false,"pushed_at":"2021-06-02T03:19:31.000Z","size":618,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-08T22:04:03.989Z","etag":null,"topics":["afnetworking","cache","ios","mvvm","mvvm-rac","networking","reactivecocoa"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Arc-lin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-10T14:28:05.000Z","updated_at":"2025-02-16T07:20:10.000Z","dependencies_parsed_at":"2022-09-13T22:41:53.957Z","dependency_job_id":null,"html_url":"https://github.com/Arc-lin/ALNetworking","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/Arc-lin/ALNetworking","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arc-lin%2FALNetworking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arc-lin%2FALNetworking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arc-lin%2FALNetworking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arc-lin%2FALNetworking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arc-lin","download_url":"https://codeload.github.com/Arc-lin/ALNetworking/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arc-lin%2FALNetworking/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264357295,"owners_count":23595575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["afnetworking","cache","ios","mvvm","mvvm-rac","networking","reactivecocoa"],"created_at":"2024-12-23T03:09:41.179Z","updated_at":"2025-07-08T22:04:04.620Z","avatar_url":"https://github.com/Arc-lin.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"ALNetworking\n==========\n\n![License MIT](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)\n![Pod version](https://img.shields.io/cocoapods/v/ALNetworking.svg?style=flat)\n[![Platform info](https://img.shields.io/cocoapods/p/ALNetworking.svg?style=flat)](http://cocoadocs.org/docsets/ALNetworking)\n![Platform version](https://img.shields.io/badge/iOS_Version-\u003e8.0-red.svg)\n\n## 这是什么\n\nALNetworking 是一个基于AFNetworking的网络层框架。通过它，我们可以使用链式调用的方式去构建一个网络请求。并且支持动态配置，支持插件化拓展，支持请求体和响应体的hook，支持缓存（基于`YYCache`），支持ReactiveCocoa方式的调用和普通方式调用等等，另外你也可以根据自己的需求，拓展出[`协程`](https://github.com/alibaba/coobjc)方式的调用，下文会阐述如何封装。\n\n另外该框架也提供了json转模型和模型数组（基于`MJExtension`），你可以选择性使用，如果想改成`YYModel`或自己的方式进行转换的话，可以参照实现。\n\n除此之外，该框架还提供了请求日志查看的功能（仅记录该框架发起的网络请求），你可以选择性使用。\n\n## 环境要求\n\n```\niOS 9.0 +\nAFNetworking 4.0.0+\nYYCache 1.0.4+\n```\n\n`RAC`拓展\n\n```\nReactiveObjC 3.1.1+\n```\n\n`RAC_MJ`拓展\n\n```\nMJExtension 3.2.1+\n```\n\n\n## 安装\n\n把下面这个东西写进你的`podfile`\n\n```\npod 'ALNetworking/Core'\n```\n\n引入json和模型转换工具\n\n```\npod 'ALNetworking/RAC_MJ'\n```\n\n引入网络请求日志工具\n\n```\npod 'ALNetworking/Recorder'\n```\n\n## 文件结构\n\n- Core/RAC\n\n|类名|说明|\n|---|---|\n|ALAPIClient|封装`AFHTTPSessionManager`的类，将`AFHTTPSessionManager`单例化，解决`AFNetworking`存在的内存泄露问题|\n|ALBaseNetworking|底层封装AFNetworking的类|\n|ALNetworkCache|封装YYCache的类|\n|ALNetworking|入口类，网络请求要发起的时候需要实例化这个类|\n|ALNetworkingConfig|基础配置类|\n|ALNetworkingConst|枚举和一些方便的宏定义|\n|ALNetworkingRequest|请求体|\n|ALNetworkingResponse|响应体|\n|ALNetworkResponseSerializer|用不同的类型解析响应体|\n|NSDictionary+ALNetworking|封装字典，防止穿空指针构建字典的时候崩溃|\n\n- RAC_MJ\n\n|类名|说明|\n|---|---|\n|ALBlockTrampoline|数组转block回调|\n|RACSignal+ALNetworking|通过MJExtension将响应体转为模型或模型数组|\n\n- UI\n\n|类名|说明|\n|---|---|\n|ALURLRecordManager|单例，用于记录网络请求日志|\n|ALURLRecordsViewController|网络请求日志列表控制器|\n|ALURLRecordDetailViewController|网络请求日志详情页|\n\n## 证书\n\nALNetworking 使用的是MIT证书,详情见LICENSE文件.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farc-lin%2Falnetworking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farc-lin%2Falnetworking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farc-lin%2Falnetworking/lists"}