Okhttp
2017-03-03 15:00:46 0 举报
okhttp 的Response,request,call相关的类图
作者其他创作
大纲/内容
Response$Builder
request: Requestprotocol: Protocolcode: intmessage: Stringhandshake: Handshakeheaders: Headersbody: ResponseBodynetworkResponse: ResponsecacheResponse: ResponsepriorResponse: ResponsesentRequestAtMillis: longreceivedResponseAtMillis: long
+ build(): Response
FormBody
- encodedNames: List- encodedValues: List
RequestBody
RealCall$AsyncCall
- responseCallback: Callback
host()request(): Requestget(): RealCall# execute()
ResponseBody
- reader: Reader
FormBody$Builder
- names: List- values: List
HttpUrl
scheme: Stringusername: String password: Stringhost: Stringport: intqueryNamesAndValues: Listurl: StringpathSegments: List
OkHttpClient
dispatcher: Dispatcherproxy: Proxyprotocols: ListconnectionSpecs: Listinterceptors: ListnetworkInterceptors: Listcache: CacheinternalCache: InternalCachesocketFactory: SocketFactorysslSocketFactory:SSLSocketFactorycertificateChainCleaner:CertificateChainCleanerhostnameVerifier:HostnameVerifiercertificatePinner:CertificatePinnerconnectionPool: ConnectionPooldns: DnsretryOnConnectionFailure: booleanconnectTimeout: intreadTimeout: int writeTimeout:int
Call
request(): Requestexecute(): Responseenqueue(Callback responseCallback)cancel()isExecuted(): booleanisCanceled(): booleanclone(): Call
Headers
- nameAndValues: String[]
+ get(String name): String+ size(): int+ name(int index): String+ value(int index): String+ names(): Set+ values(String name): List
Call$Factory
newCall(Request request): Call
MediaType
-mediaType: String-type: String- subtype: String-charset: String
+ parse(String string): MediaType
Handshake
- tlsVersion: TlsVersion- cipherSuite: CipherSuite-peerCertificates: List-localCertificates: List
Headers$Builder
namesAndValues: List
Response
request: Requestprotocol: Protocolcode: intmessage: Stringhandshake: Handshakeheaders: Headersbody: ResponseBodynetworkResponse: ResponsecacheResponse: ResponsepriorResponse: ResponsesentRequestAtMillis: longreceivedResponseAtMillis: longcacheControl: CacheControl
+ isSuccessful(): boolean+ peekBody(long byteCount): ResponseBody+ isRedirect(): boolean+ challenges(): List+ close()
Request
url: HttpUrlmethod: Stringheaders: Headersbody: RequestBodytab: Object- cacheControl: CacheControl
+ newBuilder(): Builder+ cacheControl(): CacheControl+ isHttps(): boolean
CacheControl
- noCache: boolean- noStore: boolean- maxAgeSeconds: int- sMaxAgeSeconds: int- isPrivate: boolean- isPublic: boolean- onlyIfCached: boolean- maxStaleSeconds: int- minFreshSeconds: int- noTransform: booleanheaderValue: String
+ parse(Headers headers) CacheControl
MultipartBody%Builder
- boundary: ByteString- type: MediaType- parts: List
NamedRunnable
# name: String
# execute()+ run()
RealResponseBody
- headers: Headers- source: BufferedSource
+ contentType(): MediaType+ contentLength(): long+ source(): BufferedSource
Request$Builder
url: HttpUrlmethod: Stringheaders: Headers.Builderbody: RequestBodytab: Object
Callback
RealCall
client: OkHttpClientoriginalRequest: RequestforWebSocket: booleanexecuted: booleanretryAndFollowUpInterceptor: RetryAndFollowUpInterceptor
+ request(): Request+ execute(): Response+ enqueue(Callback responseCallback)getResponseWithInterceptorChain(): Response
Dispatcher
- maxRequests: int - maxRequestsPerHost: int- idleCallback: Runnable- executorService: ExecutorService- readyAsyncCalls: Deque- runningAsyncCalls: Deque- runningSyncCalls: Deque
+ executorService(): ExecutorService+ setMaxRequests(int maxRequests)+ setMaxRequestsPerHost(int maxRequestsPerHost)+ setIdleCallback(Runnable idleCallback)+ enqueue(AsyncCall call) executed(RealCall call) finished(AsyncCall call) finished(RealCall call)+ runningCallsCount(): int + queuedCallsCount(): int + cancelAll()- runningCallsForHost(AsyncCall call)- promoteCalls()
MultipartBody
- boundary: ByteString- originalType:MediaType- contentType: MediaType- parts: List- contentLength: long
0 条评论
回复 删除
下一页