{"id":15039004,"url":"https://github.com/liangjingkanji/net","last_synced_at":"2025-05-14T07:10:14.549Z","repository":{"id":37297641,"uuid":"208626324","full_name":"liangjingkanji/Net","owner":"liangjingkanji","description":"[永久维护] Android 基于协程/OkHttp网络请求工具","archived":false,"fork":false,"pushed_at":"2024-12-20T16:27:09.000Z","size":16297,"stargazers_count":1949,"open_issues_count":8,"forks_count":227,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-11T18:18:33.613Z","etag":null,"topics":["okhttp"],"latest_commit_sha":null,"homepage":"http://liangjingkanji.github.io/Net/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liangjingkanji.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-15T16:56:08.000Z","updated_at":"2025-04-10T03:06:25.000Z","dependencies_parsed_at":"2023-11-30T21:25:25.991Z","dependency_job_id":"f7b44218-6025-4dd9-9a95-20880d47ca34","html_url":"https://github.com/liangjingkanji/Net","commit_stats":{"total_commits":701,"total_committers":13,"mean_commits":53.92307692307692,"dds":0.02853067047075608,"last_synced_commit":"0d2ab60f67df6442c613d8055c59f3a60c524022"},"previous_names":[],"tags_count":153,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangjingkanji%2FNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangjingkanji%2FNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangjingkanji%2FNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangjingkanji%2FNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liangjingkanji","download_url":"https://codeload.github.com/liangjingkanji/Net/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092792,"owners_count":22013290,"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":["okhttp"],"created_at":"2024-09-24T20:41:11.324Z","updated_at":"2025-05-14T07:10:09.529Z","avatar_url":"https://github.com/liangjingkanji.png","language":"Kotlin","readme":"\u003cp \u003e\n    \u003ca href=\"https://github.com/liangjingkanji/Net\"\u003e中文\u003c/a\u003e\n    | \u003ca href=\"https://github.com/liangjingkanji/Net/blob/master/README_EN.md\"\u003eEnglish\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/liangjingkanji/Net/master/docs/img/logo.gif\" width=\"300\"/\u003e\n\n\u003cp align=\"center\"\u003e\u003cstrong\u003e基于协程完善的Android网络请求库\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003ca href=\"http://liangjingkanji.github.io/Net/\"\u003e使用文档\u003c/a\u003e\n | \u003ca href=\"https://github.com/liangjingkanji/document/blob/master/visit-pages.md\"\u003e无法访问?\u003c/a\u003e\n | \u003ca href=\"https://liangjingkanji.github.io/document/\"\u003e贡献代码\u003c/a\u003e\n | \u003ca href=\"https://github.com/liangjingkanji/Net/releases/latest/download/net-sample.apk\"\u003e下载体验\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/liangjingkanji/Net/master/docs/img/code-preview.png\" width=\"400\"/\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://jitpack.io/#liangjingkanji/Net\"\u003e\u003cimg src=\"https://jitpack.io/v/liangjingkanji/Net.svg\"/\u003e\u003c/a\u003e\n\u003cimg src=\"https://img.shields.io/badge/language-kotlin-orange.svg\"/\u003e\n\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue\"/\u003e\n\u003ca href=\"https://liangjingkanji.github.io/Net/api/\"\u003e\u003cimg src=\"https://img.shields.io/badge/api-%E5%87%BD%E6%95%B0%E6%96%87%E6%A1%A3-red\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://raw.githubusercontent.com/liangjingkanji/liangjingkanji/master/img/group-qrcode.png\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/liangjingkanji/liangjingkanji/master/img/group.svg\"/\u003e\u003c/a\u003e\n\u003ca href=\"http://liangjingkanji.github.io/Net/updates\"\u003e\u003cimg src=\"https://img.shields.io/badge/updates-%E6%9B%B4%E6%96%B0%E6%97%A5%E5%BF%97-brightgreen\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/liangjingkanji/Net/blob/master/docs/issues.md\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/liangjingkanji/Net/master/docs/img/issues.svg\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/liangjingkanji/Net/master/docs/img/preview.png\" align=\"center\" width=\"30%;\" /\u003e\u003c/p\u003e\n\n\u003cbr\u003e\n\nNet是基于[OkHttp](https://github.com/square/okhttp)/协程的非侵入式框架(可使用所有Api), 可升级OkHttp版本保持网络安全\n\n\u003cbr\u003e\n\n[Net 1.x](https://github.com/liangjingkanji/Net/tree/1.x) 版本使用RxJava实现 \u003cbr\u003e\n[Net 2.x](https://github.com/liangjingkanji/Net/tree/2.x) 版本使用协程实现 \u003cbr\u003e\n[Net-okhttp3](https://github.com/liangjingkanji/Net-okhttp3) Net3.x的Android低版本兼容库 \u003cbr\u003e\n[Net 3.x](https://github.com/liangjingkanji/Net/) 版本使用协程实现, 可自定义OkHttp版本\n\n\u003cbr\u003e\n\u003cp align=\"center\"\u003e\u003cstrong\u003e欢迎贡献代码/问题\u003c/strong\u003e\u003c/p\u003e\n\n## 特点\n\n- [x] 开发效率No.1\n- [x] 专为Android而生\n- [x] OkHttp最佳实践\n- [x] 使用高性能Okio\n- [x] 支持OkHttp所有Api\n- [x] 随时升级OkHttp版本保证网络安全性\n- [x] 详细文档/低学习成本\n- [x] 永远保持社区维护\n\n## 主要功能\n\n- [x] 协程并发(不会协程也可上手)\n- [x] 并发/串行/队列/同步请求\n- [x] 快速切换线程\n- [x] 全局错误处理(减少崩溃率)\n- [x] 协程作用域支持错误和结束回调\n- [x] 解析任何数据(json/protocol...)的转换器\n- [x] 泛型指定网络请求返回任何类型\n- [x] 自动处理下拉刷新和上拉加载\n- [x] 自动分页加载\n- [x] 自动显示缺省页\n- [x] 自动显示加载对话框\n- [x] 自动取消请求(生命周期)\n- [x] 自动吐司错误信息\n- [x] 自动捕获异常\n- [x] 支持ViewModel\n- [x] Request携带数据(setExtra/tagOf)\n- [x] Request支持Id/Group分组\n- [x] 日志信息输出(AndroidStudio插件/App通知栏)\n- [x] 并发请求返回最快请求结果\n- [x] 全局取消请求\n- [x] Https快速配置\n- [x] Cookie持久化管理\n- [x] 定时/限时请求\n- [x] 强制缓存模式/自定义缓存Key/缓存有效期/LRU缓存算法/缓存任何数据\n- [x] 先缓存后网络请求(预览模式)\n- [x] 内置超强轮询器(计时器)\n- [x] 监听上传/下载进度(使用时间, 每秒速度, 剩余时间...)\n\n\u003cbr\u003e\n\n## 安装\n\nProject 的 settings.gradle 添加仓库\n\n```kotlin\ndependencyResolutionManagement {\n    repositories {\n        // ...\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\nModule 的 build.gradle 添加依赖框架\n\n```groovy\nimplementation \"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0\" // 协程(版本自定)\nimplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0'\nimplementation 'com.squareup.okhttp3:okhttp:4.11.0' // 要求OkHttp4以上\nimplementation 'com.github.liangjingkanji:Net:3.7.0'\n```\n如果在 Android 5 (API level 21)以下开发, 请使用 [Net-okhttp3](https://github.com/liangjingkanji/Net-okhttp3)\n\u003cbr\u003e\n\n## Contribute\n\n\u003cimg src=\"https://s2.loli.net/2022/04/24/qrYuJ5lg67kb31n.jpg\" width=\"100\"/\u003e\n\nsupported by [JetBrains](https://www.jetbrains.com/)\n\n\n## License\n\n```\nMIT License\n\nCopyright (c) 2023 劉強東\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliangjingkanji%2Fnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliangjingkanji%2Fnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliangjingkanji%2Fnet/lists"}