- 加依赖
https://github.com/square/retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
- 改gradle版本
原来版本为classpath “com.android.tools.build:gradle:4.2.2”,编译时会出现一些警告。要消除这个警告,可以尝试修改gradle版本为7.0.2。
参考网站:https://blog.csdn.net/qq_39132095/article/details/121570010
推荐阅读:
https://blog.csdn.net/weixin_36330518/article/details/113316102
https://www.jianshu.com/p/dac9a1c02525?tdsourcetag=s_pctim_aiomsg
http://ocnyang.com/2016/10/10/Retrofit2/
https://www.jianshu.com/p/e544b7a76dac 你应该知道的HTTP基础知识