类 HttpHeaders
java.lang.Object
com.lark.oapi.okhttp.internal.http.HttpHeaders
Headers and utilities for internal use by OkHttp.
-
方法概要
修饰符和类型方法说明static longcontentLength(Headers headers) static longcontentLength(Response response) static booleanReturns true if the response must have a (possibly 0-length) body.static booleanhasVaryAll(Headers responseHeaders) Returns true if a Vary header contains an asterisk.static booleanhasVaryAll(Response response) Returns true if a Vary header contains an asterisk.parseChallenges(Headers responseHeaders, String headerName) Parse RFC 7235 challenges.static intparseSeconds(String value, int defaultValue) Returnsvalueas a positive integer, or 0 if it is negative, ordefaultValueif it cannot be parsed.static voidreceiveHeaders(CookieJar cookieJar, HttpUrl url, Headers headers) static intReturns the next index ininputat or afterposthat contains a character fromcharacters.static intskipWhitespace(String input, int pos) Returns the next non-whitespace character ininputthat is white space.varyFields(Headers responseHeaders) Returns the names of the request headers that need to be checked for equality when caching.static HeadersvaryHeaders(Headers requestHeaders, Headers responseHeaders) Returns the subset of the headers inrequestHeadersthat impact the content of response's body.static HeadersvaryHeaders(Response response) Returns the subset of the headers inresponse's request that impact the content of response's body.static booleanvaryMatches(Response cachedResponse, Headers cachedRequest, Request newRequest) Returns true if none of the Vary headers have changed betweencachedRequestandnewRequest.
-
方法详细资料
-
contentLength
-
contentLength
-
varyMatches
public static boolean varyMatches(Response cachedResponse, Headers cachedRequest, Request newRequest) Returns true if none of the Vary headers have changed betweencachedRequestandnewRequest. -
hasVaryAll
Returns true if a Vary header contains an asterisk. Such responses cannot be cached. -
hasVaryAll
Returns true if a Vary header contains an asterisk. Such responses cannot be cached. -
varyFields
Returns the names of the request headers that need to be checked for equality when caching. -
varyHeaders
Returns the subset of the headers inresponse's request that impact the content of response's body. -
varyHeaders
Returns the subset of the headers inrequestHeadersthat impact the content of response's body. -
parseChallenges
Parse RFC 7235 challenges. This is awkward because we need to look ahead to know how to interpret a token.For example, the first line has a parameter name/value pair and the second line has a single token68:
WWW-Authenticate: Digest foo=bar WWW-Authenticate: Digest foo=Similarly, the first line has one challenge and the second line has two challenges:
WWW-Authenticate: Digest ,foo=bar WWW-Authenticate: Digest ,foo -
receiveHeaders
-
hasBody
Returns true if the response must have a (possibly 0-length) body. See RFC 7231. -
skipUntil
Returns the next index ininputat or afterposthat contains a character fromcharacters. Returns the input length if none of the requested characters can be found. -
skipWhitespace
Returns the next non-whitespace character ininputthat is white space. Result is undefined if input contains newline characters. -
parseSeconds
Returnsvalueas a positive integer, or 0 if it is negative, ordefaultValueif it cannot be parsed.
-