OkHttp和Retrofit2学习笔记

前言

OkHttp

资料

  1. github
  2. wiki
  3. OkHttp-完全解析
  4. OkHttp-Https

Retrofit

添加日志

1
2
3
4
5
6
7
8
9
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();  
// set your desired log level
logging.setLevel(Level.BODY);

OkHttpClient httpClient = new OkHttpClient();
// add your other interceptors …

// add logging as last interceptor
httpClient.interceptors().add(logging); // <-- this is the important line!

参考自这里

资料

用 Retrofit 2 简化 HTTP 请求
Retrofit 2.0:有史以来最大的改进
Retrofit 2 — Upgrade Guide from 1.9
Retrofit 2 — Log Requests and Responses
Love-working-with-APIS-on-Android
Retrofit2 源码解析

程序亦非猿 wechat
都看到这里了,不关注下我的公众号吗?

热评文章