public final class OkHeaders extends Object
Modifier and Type | Field and Description |
---|---|
static String |
RECEIVED_MILLIS
Synthetic response header: the local time when the response was received.
|
static String |
RESPONSE_SOURCE
Synthetic response header: the location from which the response was loaded.
|
static String |
SELECTED_PROTOCOL
Synthetic response header: the selected
protocol ("spdy/3.1", "http/1.1", etc). |
static String |
SENT_MILLIS
Synthetic response header: the local time when the request was sent.
|
Modifier and Type | Method and Description |
---|---|
static void |
addCookies(Request.Builder builder,
Map<String,List<String>> cookieHeaders) |
static long |
contentLength(Headers headers) |
static long |
contentLength(Request request) |
static long |
contentLength(Response response) |
static boolean |
hasVaryAll(Headers responseHeaders)
Returns true if a Vary header contains an asterisk.
|
static boolean |
hasVaryAll(Response response)
Returns true if a Vary header contains an asterisk.
|
static List<Challenge> |
parseChallenges(Headers responseHeaders,
String challengeHeader)
Parse RFC 2617 challenges.
|
static Request |
processAuthHeader(Authenticator authenticator,
Response response,
Proxy proxy)
React to a failed authorization response by looking up new credentials.
|
static Map<String,List<String>> |
toMultimap(Headers headers,
String valueForNullKey)
Returns an immutable map containing each field to its list of values.
|
static Set<String> |
varyFields(Headers responseHeaders)
Returns the names of the request headers that need to be checked for
equality when caching.
|
static Headers |
varyHeaders(Headers requestHeaders,
Headers responseHeaders)
Returns the subset of the headers in
requestHeaders that
impact the content of response's body. |
static Headers |
varyHeaders(Response response)
Returns the subset of the headers in
response 's request that
impact the content of response's body. |
static boolean |
varyMatches(Response cachedResponse,
Headers cachedRequest,
Request newRequest)
Returns true if none of the Vary headers have changed between
cachedRequest and newRequest . |
public static final String SENT_MILLIS
public static final String RECEIVED_MILLIS
public static final String SELECTED_PROTOCOL
protocol
("spdy/3.1", "http/1.1", etc).public static final String RESPONSE_SOURCE
public static long contentLength(Request request)
public static long contentLength(Response response)
public static long contentLength(Headers headers)
public static Map<String,List<String>> toMultimap(Headers headers, String valueForNullKey)
valueForNullKey
- the request line for requests, or the status line
for responses. If non-null, this value is mapped to the null key.public static void addCookies(Request.Builder builder, Map<String,List<String>> cookieHeaders)
public static boolean varyMatches(Response cachedResponse, Headers cachedRequest, Request newRequest)
cachedRequest
and newRequest
.public static boolean hasVaryAll(Response response)
public static boolean hasVaryAll(Headers responseHeaders)
public static Set<String> varyFields(Headers responseHeaders)
public static Headers varyHeaders(Response response)
response
's request that
impact the content of response's body.public static Headers varyHeaders(Headers requestHeaders, Headers responseHeaders)
requestHeaders
that
impact the content of response's body.public static List<Challenge> parseChallenges(Headers responseHeaders, String challengeHeader)
public static Request processAuthHeader(Authenticator authenticator, Response response, Proxy proxy) throws IOException
IOException
Copyright © 2017. All rights reserved.