Package | Description |
---|---|
okhttp3 |
An HTTP+HTTP/2 client for Android and Java applications.
|
okhttp3.internal | |
okhttp3.internal.cache | |
okhttp3.internal.connection | |
okhttp3.internal.http | |
okhttp3.internal.http1 | |
okhttp3.internal.http2 | |
okhttp3.logging |
An OkHttp interceptor which logs HTTP request and response data.
|
Modifier and Type | Field and Description |
---|---|
(package private) Headers |
MultipartBody.Part.headers |
(package private) Headers |
Request.headers |
(package private) Headers |
Response.headers |
private Headers |
Cache.Entry.responseHeaders |
private Headers |
Cache.Entry.varyHeaders |
Modifier and Type | Method and Description |
---|---|
Headers |
Headers.Builder.build() |
Headers |
MultipartBody.Part.headers() |
Headers |
Request.headers() |
Headers |
Response.headers() |
static Headers |
Headers.of(java.util.Map<java.lang.String,java.lang.String> headers)
Returns headers for the header names and values in the
Map . |
static Headers |
Headers.of(java.lang.String... namesAndValues)
Returns headers for the alternating header names and values.
|
Headers |
Response.trailers()
Returns the trailers after the HTTP response, which may be empty.
|
Modifier and Type | Method and Description |
---|---|
Headers.Builder |
Headers.Builder.addAll(Headers headers)
Adds all headers from an existing collection.
|
MultipartBody.Builder |
MultipartBody.Builder.addPart(Headers headers,
RequestBody body)
Add a part to the body.
|
static MultipartBody.Part |
MultipartBody.Part.create(Headers headers,
RequestBody body) |
Request.Builder |
Request.Builder.headers(Headers headers)
Removes all headers on this builder and adds
headers . |
Response.Builder |
Response.Builder.headers(Headers headers)
Removes all headers on this builder and adds
headers . |
static CacheControl |
CacheControl.parse(Headers headers)
Returns the cache directives of
headers . |
static java.util.List<Cookie> |
Cookie.parseAll(HttpUrl url,
Headers headers)
Returns all of the cookies from a set of HTTP response headers.
|
Constructor and Description |
---|
Part(Headers headers,
RequestBody body) |
Modifier and Type | Field and Description |
---|---|
static Headers |
Util.EMPTY_HEADERS |
Modifier and Type | Method and Description |
---|---|
static Headers |
Util.toHeaders(java.util.List<Header> headerBlock) |
Modifier and Type | Method and Description |
---|---|
static java.util.List<Header> |
Util.toHeaderBlock(Headers headers) |
Modifier and Type | Method and Description |
---|---|
private static Headers |
CacheInterceptor.combine(Headers cachedHeaders,
Headers networkHeaders)
Combines cached headers with a network headers as defined by RFC 7234, 4.3.4.
|
Modifier and Type | Method and Description |
---|---|
private static Headers |
CacheInterceptor.combine(Headers cachedHeaders,
Headers networkHeaders)
Combines cached headers with a network headers as defined by RFC 7234, 4.3.4.
|
Modifier and Type | Method and Description |
---|---|
Headers |
Exchange.trailers() |
Modifier and Type | Method and Description |
---|---|
Headers |
ExchangeCodec.trailers()
Returns the trailers after the HTTP response.
|
static Headers |
HttpHeaders.varyHeaders(Headers requestHeaders,
Headers responseHeaders)
Returns the subset of the headers in
requestHeaders that impact the content of
response's body. |
static Headers |
HttpHeaders.varyHeaders(Response response)
Returns the subset of the headers in
response 's request that impact the content of
response's body. |
Modifier and Type | Method and Description |
---|---|
static long |
HttpHeaders.contentLength(Headers headers) |
static boolean |
HttpHeaders.hasVaryAll(Headers responseHeaders)
Returns true if a Vary header contains an asterisk.
|
static java.util.List<Challenge> |
HttpHeaders.parseChallenges(Headers responseHeaders,
java.lang.String headerName)
Parse RFC 7235 challenges.
|
static void |
HttpHeaders.receiveHeaders(CookieJar cookieJar,
HttpUrl url,
Headers headers) |
static java.util.Set<java.lang.String> |
HttpHeaders.varyFields(Headers responseHeaders)
Returns the names of the request headers that need to be checked for equality when caching.
|
static Headers |
HttpHeaders.varyHeaders(Headers requestHeaders,
Headers responseHeaders)
Returns the subset of the headers in
requestHeaders that impact the content of
response's body. |
static boolean |
HttpHeaders.varyMatches(Response cachedResponse,
Headers cachedRequest,
Request newRequest)
Returns true if none of the Vary headers have changed between
cachedRequest and newRequest . |
Modifier and Type | Field and Description |
---|---|
private Headers |
Http1ExchangeCodec.trailers
Received trailers.
|
Modifier and Type | Method and Description |
---|---|
private Headers |
Http1ExchangeCodec.readHeaders()
Reads headers or trailers.
|
Headers |
Http1ExchangeCodec.trailers() |
Modifier and Type | Method and Description |
---|---|
void |
Http1ExchangeCodec.writeRequest(Headers headers,
java.lang.String requestLine)
Returns bytes of a request header for sending on an HTTP transport.
|
Modifier and Type | Field and Description |
---|---|
private Headers |
Http2Stream.FramingSource.trailers
Received trailers.
|
private Headers |
Http2Stream.FramingSink.trailers
Trailers to send at the end of the stream.
|
Modifier and Type | Field and Description |
---|---|
private java.util.Deque<Headers> |
Http2Stream.headersQueue
|
Modifier and Type | Method and Description |
---|---|
Headers |
Http2Stream.takeHeaders()
Removes and returns the stream's received response headers, blocking if necessary until headers
have been received.
|
Headers |
Http2ExchangeCodec.trailers() |
Headers |
Http2Stream.trailers()
Returns the trailers.
|
Modifier and Type | Method and Description |
---|---|
void |
Http2Stream.enqueueTrailers(Headers trailers) |
static Response.Builder |
Http2ExchangeCodec.readHttp2HeadersList(Headers headerBlock,
Protocol protocol)
Returns headers for a name value block containing an HTTP/2 response.
|
(package private) void |
Http2Stream.receiveHeaders(Headers headers,
boolean inFinished)
Accept headers from the network and store them until the client calls
Http2Stream.takeHeaders() , or
Http2Stream.FramingSource.read(okio.Buffer, long) them. |
Constructor and Description |
---|
Http2Stream(int id,
Http2Connection connection,
boolean outFinished,
boolean inFinished,
Headers headers) |
Modifier and Type | Method and Description |
---|---|
private static boolean |
HttpLoggingInterceptor.bodyHasUnknownEncoding(Headers headers) |
private void |
HttpLoggingInterceptor.logHeader(Headers headers,
int i) |