RetrofitClient
基于Retrofit2.x和Rxjava2.x封装的请求工具类(内含Retrofit2.x & rxjava1.x)
Install / Use
/learn @Tamicer/RetrofitClientREADME
RetrofitClient
基于Retrofit和Rxjava封装的请求工具类
Base Retrofit& Rxjava Encapsulates the request of the tools

GET
RetrofitClient.getInstance(context)
.createBaseApi()
.get("you path url"
,maps, maps, new Subscriber<IpResult>());
POST
RetrofitClient.getInstance(context)
.createBaseApi(
).post("you path url"
,maps, maps, new Subscriber<IpResult>());
JSON
RequestBody jsonbody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(user));
RetrofitClient.getInstance(MainActivity.this)
.createBaseApi()
.json("url", jsonBody, new BaseSubscriber<T>(context) {
}
#UpLoad
RequestBody requestFile =
RequestBody.create(MediaType.parse("image/jpg"), new File(mPath));
RetrofitClient.getInstance(MainActivity.this)
.createBaseApi()
.upload(url, requestFile, new Subscriber<ResponseBody>);
Download
RetrofitClient.getInstance(MainActivity.this)
.createBaseApi()
.download(url1, new CallBack());
Execute you APIService
//create you APiService
MyApiService service = RetrofitClient.getInstance(MainActivity.this).create(MyApiService.class);
// execute and add observable
RetrofitClient.getInstance(MainActivity.this).execute(
service.getData("21.22.11.33"), new Subscriber<IpResult>() {
});}
更多介绍:http://www.jianshu.com/p/29c2a9ac5abf
http://blog.csdn.net/sk719887916/article/details/51958010
Author : Tamic
推荐使用:
Novate: https://github.com/Tamicer/Novate
Related Skills
node-connect
346.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
