OkHttp
Last updated
Was this helpful?
Last updated
Was this helpful?
参考:
创建OkHttp实例,可通过OkHttpClient.Builder
添加拦截器等自定配置
请求网络,可以同步/异步
通过OkHttpClient.newCall内部的RealCall发起网络请求(execute同步请求和enqueue异步请求,异步请求有DIspatcher进行分发),getResponseWithInterceptorChain
,RetryAndFollowUpInterceptors
, 以及BridgeInterceptor
, CacheInterceptor
, ConnectInterceptor
, NetworkInterceptor
, CallServerInterceptor
进行请求处理,最后返回请求结果,请求结束。