倒霉的菜鸟

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2021年10月21日

摘要: okhttp时一个http client, 它脱离了对原生的依赖, 从创建socket开始,整套都是自己写的 , 我们简单使用如下 1 val client = OkHttpClient.Builder().build() 2 val request = Request.Builder().url( 阅读全文
posted @ 2021-10-21 17:30 倒霉的菜鸟 阅读(917) 评论(0) 推荐(0) 编辑

摘要: Retrofit是对okhttp的包装, 先看下简单使用: 1, 引入依赖 1 implementation 'com.squareup.retrofit2:retrofit:2.9.0' 2 implementation 'com.squareup.retrofit2:converter-gson 阅读全文
posted @ 2021-10-21 16:14 倒霉的菜鸟 阅读(300) 评论(0) 推荐(0) 编辑