okhttp之我的理解

2017-12-08  本文已影响25人  sunrise10

okhttp的使用步骤分为三步

response = getResponseWithInterceptorChain() 

得到response 并通过call对象的 new 出来的callBack回调到子线程中。

okhttp采用责任链的设计模式
,运用拦截器对request和response进行修改,okhttp内部维护了一个存放interceptor的集合
这里画个图来看看


image
上一篇 下一篇

猜你喜欢

热点阅读