urlname
type
Post
password
SyncToConfluence
category
Android
date
Feb 24, 2023 15:03
slug
800f0e8f5267
icon
Button
catalog
summary
tags
Android
OkHttp
cover
Status
BusyTime
Status 1
status
Published

RetryAndFollowUpInterceptor

This interceptor recovers from failures and follows redirects as necessary. It may throw an IOException if the call was canceled.
失败和重定向拦截器

BridgeInterceptor

Bridges from application code to network code. First it builds a network request from a user request. Then it proceeds to call the network. Finally it builds a user response from the network response.
封装 requestresponse 拦截器

CacheInterceptor

Serves requests from the cache and writes responses to the cache.
缓存相关的过滤器,负责读取缓存直接返回、更新缓存

ConnectInterceptor

Opens a connection to the target server and proceeds to the next interceptor. The network might be used for the returned response, or to validate a cached response with a conditional GET.
连接服务,负责和服务器建立连接,在这里真正的请求网络

Client.networkInterceptors

CallServerInterceptor

This is the last interceptor in the chain. It makes a network call to the server.
执行流操作(写出请求体、获得响应数据) 负责向服务器发送请求数据、从服务器读取响应数据 进行http请求报文的封装与请求报文的解析

参考/推荐

Leetcode_21-合并两个有序链表okhttp 重要类作用
Loading...