[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7331":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":34,"lastSyncTime":35,"discoverSource":36},7331,"rxhttp","liujingxing\u002Frxhttp","liujingxing"," 🔥🔥🔥 Based on OkHttp encapsulation, support Kotlin Coroutines、RxJava2、RxJava3; 30s to get started.","https:\u002F\u002Fjuejin.im\u002Fpost\u002F5ded221a518825125d14a1d4",null,"Kotlin",3819,462,57,12,0,1,30,"Apache License 2.0",false,"master",true,[24,25,26,27,28,5,29,30],"andriod","kotlin-coroutines","okhttp-rxhttp","okhttp3","retrofit2","rxjava2","rxjava3","2026-06-12 02:01:38","# RxHttp\n\nEnglish | [中文文档](https:\u002F\u002Fgithub.com\u002Fliujingxing\u002Frxhttp\u002Fblob\u002Fmaster\u002FREADME_zh.md)\n\n[![](https:\u002F\u002Fjitpack.io\u002Fv\u002Fliujingxing\u002Frxhttp.svg)](https:\u002F\u002Fjitpack.io\u002F#liujingxing\u002Frxhttp)\n\n# [(RxHttp 3.0 更新指南，升级必看)](https:\u002F\u002Fgithub.com\u002Fliujingxing\u002Frxhttp\u002Fwiki\u002FRxHttp-3.0-%E6%9B%B4%E6%96%B0%E6%8C%87%E5%8D%97%EF%BC%8C%E5%8D%87%E7%BA%A7%E5%BF%85%E7%9C%8B)\n\n# 使用RxHttp的知名App\n\n\u003Cimg src=\"https:\u002F\u002Fpp.myapp.com\u002Fma_icon\u002F0\u002Ficon_54221929_1770021797\u002F256\" width=\"100\" height=\"100\"\u002F> \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F1d263296-19b8-4e06-a19f-b656b0dcf4dc\" width=\"100\" height=\"100\"\u002F>\n\n抖音旗下***汽水音乐***(app v18.1.0 设置\u002F关于汽水音乐\u002F开源软件声明 可查)\n\n\u003C!--https:\u002F\u002Fuinotes-img.oss-cn-shanghai.aliyuncs.com\u002Flogo\u002Forigin-webp\u002F321899153012164010.webp-->\n\n\n# A type-safe HTTP client for Android. Written based on OkHttp\n\n\n![sequence_chart_en.jpg](https:\u002F\u002Fp6-juejin.byteimg.com\u002Ftos-cn-i-k3u1fbpfcp\u002F2e25f9c6aa694b57bd43871eff95cecd~tplv-k3u1fbpfcp-watermark.image)\n\n\n\u003Ctable>\n  \u003Ctr>\n     \u003Cth align=\"center\">Await\u003C\u002Fth>\n     \u003Cth align=\"center\">Flow\u003C\u002Fth>\n     \u003Cth align=\"center\">RxJava\u003Cbr>(Kotlin)\u003C\u002Fth>\n     \u003Cth align=\"center\">RxJava\u003Cbr>(Java)\u003C\u002Fth>\n  \u003C\u002Ftr>\n \n \u003Ctr>\n \u003Ctd>\n  \n  ```java\n  \u002F\u002Fawait return User\n  \u002F\u002FtryAwait return User?\n  val user = RxHttp.get(\"\u002Fserver\u002F..\")\n      .add(\"key\", \"value\")\n      .toAwait\u003CUser>()\n      .await() \n  \n  \u002F\u002For awaitResult return kotlin.Result\u003CT>\n  RxHttp.get(\"\u002Fserver\u002F..\")\n      .add(\"key\", \"value\")\n      .toAwait\u003CUser>()  \n      .awaitResult { \n          \u002F\u002FSuccess\n      }.onFailure {  \n          \u002F\u002FFailure\n      } \n  ```\n \u003C\u002Ftd>\n  \n   \u003Ctd>\n  \n  ```java\n  RxHttp.get(\"\u002Fserver\u002F..\")\n      .add(\"key\", \"value\")\n      .toFlow\u003CUser>()  \n      .catch { \n          \u002F\u002FFailure\n      }.collect {  \n          \u002F\u002FSuccess\n      }           \n  ```\n \u003C\u002Ftd>\n    \n   \u003Ctd>\n  \n  ```java\n  RxHttp.get(\"\u002Fserver\u002F..\")\n      .add(\"key\", \"value\")\n      .toObservable\u003CUser>()  \n      .subscribe({ \n          \u002F\u002FSuccess\n      }, {  \n          \u002F\u002FFailure\n      })           \n  ```\n \u003C\u002Ftd>\n    \n   \u003Ctd>\n  \n  ```java\n  RxHttp.get(\"\u002Fserver\u002F..\")\n      .add(\"key\", \"value\")\n      .toObservable(User.class)  \n      .subscribe(user - > { \n          \u002F\u002FSuccess\n      }, throwable -> {  \n          \u002F\u002FFailure\n      })           \n  ```\n \u003C\u002Ftd>\n  \n \u003C\u002Ftr>\n \n \u003C\u002Ftable>\n\n\n\n## 1、Feature\n\n- Support kotlin coroutines, RxJava2, RxJava3\n\n- Support Gson, Xml, ProtoBuf, FastJson and other third-party data parsing tools\n\n- Supports automatic closure of requests in FragmentActivity, Fragment, View, ViewModel, and any class\n\n- Support global encryption and decryption, add common parameters and headers, network cache, all support a request set up separately\n\n## 2、usage\n\n1、Adding dependencies and configurations\n\n### Required\n\n\u003Cdetails>\n\u003Csummary>1、Add jitpack to your build.gradle\u003C\u002Fsummary>\n \n```java\nallprojects {\n    repositories {\n        maven { url \"https:\u002F\u002Fjitpack.io\" }\n    }\n}\n```\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>2、Java 8 or higher\u003C\u002Fsummary>\n \n```java\nandroid {\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_8\n        targetCompatibility JavaVersion.VERSION_1_8\n    }\n}\n```\n\u003C\u002Fdetails>\n\u003Cdetails open>\n\u003Csummary>3、Add RxHttp dependency\u003C\u002Fsummary>\n \n```kotlin\nplugins {\n    \u002F\u002F kapt\u002Fksp choose one\n    \u002F\u002F id 'kotlin-kapt'\n    id 'com.google.devtools.ksp' version '2.3.4'\n}\n    \ndependencies {\n    def rxhttp_version = '3.5.1'\n    implementation 'com.squareup.okhttp3:okhttp:4.12.0'  \n    implementation \"com.github.liujingxing.rxhttp:rxhttp:$rxhttp_version\"\n    \u002F\u002F ksp\u002Fkapt\u002FannotationProcessor choose one\n    ksp \"com.github.liujingxing.rxhttp:rxhttp-compiler:$rxhttp_version\"\n }\n```\n\u003C\u002Fdetails>\n\n### Optional\n\n### 1、Converter\n```kotlin\nimplementation \"com.github.liujingxing.rxhttp:converter-serialization:$rxhttp_version\"\nimplementation \"com.github.liujingxing.rxhttp:converter-fastjson:$rxhttp_version\"\nimplementation \"com.github.liujingxing.rxhttp:converter-jackson:$rxhttp_version\"\nimplementation \"com.github.liujingxing.rxhttp:converter-moshi:$rxhttp_version\"\nimplementation \"com.github.liujingxing.rxhttp:converter-protobuf:$rxhttp_version\"\nimplementation \"com.github.liujingxing.rxhttp:converter-simplexml:$rxhttp_version\"\n```\n\n### 2、RxJava\n\u003Cdetails open>\n\u003Csummary>RxHttp + RxJava3\u003C\u002Fsummary>\n \n ```java\nimplementation 'io.reactivex.rxjava3:rxjava:3.1.6'\nimplementation 'io.reactivex.rxjava3:rxandroid:3.0.2'\nimplementation 'com.github.liujingxing.rxlife:rxlife-rxjava3:2.2.2' \u002F\u002FRxJava3, Automatic close request\n```\n \n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>RxHttp + RxJava2\u003C\u002Fsummary>\n \n```java\nimplementation 'io.reactivex.rxjava2:rxjava:2.2.8'\nimplementation 'io.reactivex.rxjava2:rxandroid:2.1.1'\nimplementation 'com.github.liujingxing.rxlife:rxlife-rxjava2:2.2.2' \u002F\u002FRxJava2, Automatic close request\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails open>\n\u003Csummary>ksp passes the RxJava version\u003C\u002Fsummary>\n \n```java\nksp {\n    arg(\"rxhttp_rxjava\", \"3.1.6\")\n}\n```\n \n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Kapt passes the RxJava version\u003C\u002Fsummary>\n \n```java\nkapt {\n    arguments {\n        arg(\"rxhttp_rxjava\", \"3.1.6\")\n    }\n}\n```\n \n\u003C\u002Fdetails>\n \n\u003Cdetails>\n\u003Csummary>javaCompileOptions passes the RxJava version\u003C\u002Fsummary>\n \n```java\nandroid {\n    defaultConfig {\n        javaCompileOptions {\n            annotationProcessorOptions {\n                arguments = [\n                    rxhttp_rxjava: '3.1.6', \n                ]\n            }\n        }\n    }\n}\n```\n \n\u003C\u002Fdetails>\n\n\n### 3、set RxHttp class package name\n\n\u003Cdetails open>\n\u003Csummary>ksp pass package name\u003C\u002Fsummary>\n \n```java\nksp {\n     arg(\"rxhttp_package\", \"rxhttp.xxx\")\n}\n```\n    \n\u003Cdetails>\n\u003Csummary>kapt pass package name\u003C\u002Fsummary>\n \n```java\nkapt {\n    arguments {\n       arg(\"rxhttp_package\", \"rxhttp.xxx\") \n    }\n}\n```\n \n\u003C\u002Fdetails>\n \n\u003Cdetails>\n\u003Csummary>javaCompileOptions pass package name\u003C\u002Fsummary>\n \n```java\nandroid {\n    defaultConfig {\n        javaCompileOptions {\n            annotationProcessorOptions {\n                arguments = [\n                    rxhttp_package: 'rxhttp.xxx'\n                ]\n            }\n        }\n    }\n}\n```\n\u003C\u002Fdetails>\n\n\n**Finally, rebuild the project, which is necessary**\n\n2、Initialize the SDK\n\nThis step is optional\n\n```java\nRxHttpPlugins.init(OkHttpClient)  \n    .setDebug(boolean)  \n    .setOnParamAssembly(Consumer)\n    ....\n```\n\n3、Configuration BaseUrl\n\nThis step is optional\n\n```java\npublic class Url {\n\n    \u002F\u002FAdd the @defaultDomain annotation to BASE_URL\n    @DefaultDomain\n    public static BASE_URL = \"https:\u002F\u002F...\"\n}\n```\n\n4、Perform the requested\n\n```java\n\u002F\u002F java\nRxHttp.get(\"\u002Fservice\u002F...\")   \u002F\u002F1、You can choose get,postFrom,postJson etc\n    .addQuery(\"key\", \"value\")               \u002F\u002Fadd query param\n    .addHeader(\"headerKey\", \"headerValue\")  \u002F\u002Fadd request header\n    .toObservable(Student.class)  \u002F\u002F2、Use the toXxx method to determine the return value type, customizable\n    .subscribe(student -> {  \u002F\u002F3、Subscribing observer\n        \u002F\u002FSuccess callback，Default IO thread\n    }, throwable -> {\n        \u002F\u002FAbnormal callback\n    });\n\n\u002F\u002F kotlin \nRxHttp.postForm(\"\u002Fservice\u002F...\")          \u002F\u002Fpost FormBody\n    .add(\"key\", \"value\")                 \u002F\u002Fadd param to body\n    .addQuery(\"key1\", \"value1\")          \u002F\u002Fadd query param\n    .addFile(\"file\", File(\"...\u002F1.png\"))  \u002F\u002Fadd file to body\n    .toObservable\u003CStudent>()           \n    .subscribe({ student ->       \n        \u002F\u002FDefault IO thread\n    }, { throwable ->\n        \n    })\n\n\u002F\u002F kotlin coroutine\nval students = RxHttp.postJson(\"\u002Fservice\u002F...\")  \u002F\u002F1、post {application\u002Fjson; charset=utf-8}\n    .toAwaitList\u003CStudent>()                          \u002F\u002F2、Use the toXxx method to determine the return value type, customizable\n    .await()                                    \u002F\u002F3、Get the return value, await is the suspend method\n```\n\n## 3、Advanced usage\n\n 1、Close the request\n\n```java\n\u002F\u002FIn Rxjava2 , Automatic close request\nRxHttp.get(\"\u002Fservice\u002F...\")\n    .toObservableString()\n    .as(RxLife.as(this))  \u002F\u002FThe Activity destroys and automatically closes the request\n    .subscribe(s -> {\n        \u002F\u002FDefault IO thread\n    }, throwable -> {\n\n    });\n\n\u002F\u002FIn Rxjava3 , Automatic close request\nRxHttp.get(\"\u002Fservice\u002F...\")\n    .toObservableString()\n    .to(RxLife.to(this))  \u002F\u002FThe Activity destroys and automatically closes the request\n    .subscribe(s -> {\n        \u002F\u002FDefault IO thread\n    }, throwable -> {\n        \n    });\n\n\n\u002F\u002FIn RxJava2\u002FRxJava3, close the request manually\nDisposable disposable = RxHttp.get(\"\u002Fservice\u002F...\")\n    .toObservableString()\n    .subscribe(s -> {\n        \u002F\u002FDefault IO thread\n    }, throwable -> {\n        \n    });\n\ndisposable.dispose(); \u002F\u002FClose the request at the appropriate time\n```\n\n## 4、ProGuard\n\nIf you are using RxHttp v2.2.8 or above the shrinking and obfuscation rules are included automatically.\nOtherwise you must manually add the options in [rxhttp.pro](https:\u002F\u002Fgithub.com\u002Fliujingxing\u002Frxhttp\u002Fblob\u002Fmaster\u002Frxhttp\u002Fsrc\u002Fmain\u002Fresources\u002FMETA-INF\u002Fproguard\u002Frxhttp.pro).\n\n## 5、Donations\n\nIf this project helps you a lot and you want to support the project's development and maintenance of this project, feel free to scan the following QR code for donation. Your donation is highly appreciated. Thank you!\n\n![donations.png](https:\u002F\u002Fp1-juejin.byteimg.com\u002Ftos-cn-i-k3u1fbpfcp\u002Ffa6d3941c2c944e59831640fa0ece60d~tplv-k3u1fbpfcp-watermark.image?)\n\n# Licenses\n\n```\nCopyright 2019 liujingxing\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","RxHttp 是一个基于 OkHttp 封装的 Android 类型安全 HTTP 客户端，支持 Kotlin 协程、RxJava2 和 RxJava3。该项目的核心功能包括支持多种第三方数据解析工具（如 Gson、Xml、ProtoBuf、FastJson），自动管理请求生命周期，在 FragmentActivity、Fragment、View、ViewModel 以及任何类中自动关闭请求，同时提供全局加密解密、添加公共参数和头部、网络缓存等功能，并允许为每个请求单独设置这些配置。RxHttp 适用于需要高效、灵活且易于集成的网络请求处理场景，特别适合于对响应式编程有需求或者偏好使用 Kotlin 协程进行异步操作的应用开发。",2,"2026-06-11 03:11:48","top_language"]