Skip navigation links
A B C D E F G H I J L M N O P Q R S T U V W 

A

add(String, String...) - Method in class com.squareup.okhttp.CertificatePinner.Builder
Pins certificates for hostname.
add(String, String) - Method in class com.squareup.okhttp.FormEncodingBuilder
Add new key-value pair.
add(String) - Method in class com.squareup.okhttp.Headers.Builder
Add an header line containing a field name, a literal colon, and a value.
add(String, String) - Method in class com.squareup.okhttp.Headers.Builder
Add a field with the specified value.
addEncoded(String, String) - Method in class com.squareup.okhttp.FormEncodingBuilder
Add new key-value pair.
addEncodedPathSegment(String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
addEncodedQueryParameter(String, String) - Method in class com.squareup.okhttp.HttpUrl.Builder
Adds the pre-encoded query parameter to this URL's query string.
addFormDataPart(String, String) - Method in class com.squareup.okhttp.MultipartBuilder
Add a form data part to the body.
addFormDataPart(String, String, RequestBody) - Method in class com.squareup.okhttp.MultipartBuilder
Add a form data part to the body.
addHeader(String, String) - Method in class com.squareup.okhttp.Request.Builder
Adds a header with name and value.
addHeader(String, String) - Method in class com.squareup.okhttp.Response.Builder
Adds a header with name and value.
addPart(RequestBody) - Method in class com.squareup.okhttp.MultipartBuilder
Add a part to the body.
addPart(Headers, RequestBody) - Method in class com.squareup.okhttp.MultipartBuilder
Add a part to the body.
addPathSegment(String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
addQueryParameter(String, String) - Method in class com.squareup.okhttp.HttpUrl.Builder
Encodes the query parameter using UTF-8 and adds it to this URL's query string.
Address - Class in com.squareup.okhttp
A specification for a connection to an origin server.
Address(String, int, Dns, SocketFactory, SSLSocketFactory, HostnameVerifier, CertificatePinner, Authenticator, Proxy, List<Protocol>, List<ConnectionSpec>, ProxySelector) - Constructor for class com.squareup.okhttp.Address
 
allEnabledCipherSuites() - Method in class com.squareup.okhttp.ConnectionSpec.Builder
 
allEnabledTlsVersions() - Method in class com.squareup.okhttp.ConnectionSpec.Builder
 
ALTERNATIVE - Static variable in class com.squareup.okhttp.MultipartBuilder
The "multipart/alternative" type is syntactically identical to "multipart/mixed", but the semantics are different.
authenticate(Proxy, Response) - Method in interface com.squareup.okhttp.Authenticator
Returns a request that includes a credential to satisfy an authentication challenge in response.
authenticateProxy(Proxy, Response) - Method in interface com.squareup.okhttp.Authenticator
Returns a request that includes a credential to satisfy an authentication challenge made by response.
Authenticator - Interface in com.squareup.okhttp
Responds to authentication challenges from the remote web or proxy server.

B

basic(String, String) - Static method in class com.squareup.okhttp.Credentials
Returns an auth credential for the Basic scheme.
body() - Method in class com.squareup.okhttp.Request
 
body() - Method in class com.squareup.okhttp.Response
 
body(ResponseBody) - Method in class com.squareup.okhttp.Response.Builder
 
build() - Method in class com.squareup.okhttp.CacheControl.Builder
 
build() - Method in class com.squareup.okhttp.CertificatePinner.Builder
 
build() - Method in class com.squareup.okhttp.ConnectionSpec.Builder
 
build() - Method in class com.squareup.okhttp.FormEncodingBuilder
 
build() - Method in class com.squareup.okhttp.Headers.Builder
 
build() - Method in class com.squareup.okhttp.HttpUrl.Builder
 
build() - Method in class com.squareup.okhttp.MultipartBuilder
Assemble the specified parts into a request body.
build() - Method in class com.squareup.okhttp.Request.Builder
 
build() - Method in class com.squareup.okhttp.Response.Builder
 
Builder() - Constructor for class com.squareup.okhttp.CacheControl.Builder
 
Builder() - Constructor for class com.squareup.okhttp.CertificatePinner.Builder
 
Builder(ConnectionSpec) - Constructor for class com.squareup.okhttp.ConnectionSpec.Builder
 
Builder() - Constructor for class com.squareup.okhttp.Headers.Builder
 
Builder() - Constructor for class com.squareup.okhttp.HttpUrl.Builder
 
Builder() - Constructor for class com.squareup.okhttp.Request.Builder
 
Builder() - Constructor for class com.squareup.okhttp.Response.Builder
 
bytes() - Method in class com.squareup.okhttp.ResponseBody
 
byteStream() - Method in class com.squareup.okhttp.ResponseBody
 

C

Cache - Class in com.squareup.okhttp
Caches HTTP and HTTPS responses to the filesystem so they may be reused, saving time and bandwidth.
Cache(File, long) - Constructor for class com.squareup.okhttp.Cache
 
CacheControl - Class in com.squareup.okhttp
A Cache-Control header with cache directives from a server or client.
cacheControl(CacheControl) - Method in class com.squareup.okhttp.Request.Builder
Sets this request's Cache-Control header, replacing any cache control headers already present.
cacheControl() - Method in class com.squareup.okhttp.Request
Returns the cache control directives for this response.
cacheControl() - Method in class com.squareup.okhttp.Response
Returns the cache control directives for this response.
CacheControl.Builder - Class in com.squareup.okhttp
Builds a Cache-Control request header.
cacheResponse(Response) - Method in class com.squareup.okhttp.Response.Builder
 
cacheResponse() - Method in class com.squareup.okhttp.Response
Returns the raw response received from the cache.
Call - Class in com.squareup.okhttp
A call is a request that has been prepared for execution.
Call(OkHttpClient, Request) - Constructor for class com.squareup.okhttp.Call
 
Callback - Interface in com.squareup.okhttp
 
cancel() - Method in class com.squareup.okhttp.Call
Cancels the request, if possible.
cancel(Object) - Method in class com.squareup.okhttp.Dispatcher
Cancel all calls with the tag tag.
cancel(Object) - Method in class com.squareup.okhttp.OkHttpClient
Cancels all scheduled or in-flight calls tagged with tag.
CertificatePinner - Class in com.squareup.okhttp
Constrains which certificates are trusted.
CertificatePinner.Builder - Class in com.squareup.okhttp
Builds a configured certificate pinner.
Challenge - Class in com.squareup.okhttp
An RFC 2617 challenge.
Challenge(String, String) - Constructor for class com.squareup.okhttp.Challenge
 
challenges() - Method in class com.squareup.okhttp.Response
Returns the authorization challenges appropriate for this response's code.
charset() - Method in class com.squareup.okhttp.MediaType
Returns the charset of this media type, or null if this media type doesn't specify a charset.
charset(Charset) - Method in class com.squareup.okhttp.MediaType
Returns the charset of this media type, or defaultValue if this media type doesn't specify a charset.
charStream() - Method in class com.squareup.okhttp.ResponseBody
Returns the response as a character stream decoded with the charset of the Content-Type header.
check(String, List<Certificate>) - Method in class com.squareup.okhttp.CertificatePinner
Confirms that at least one of the certificates pinned for hostname is in peerCertificates.
check(String, Certificate...) - Method in class com.squareup.okhttp.CertificatePinner
Deprecated.
CipherSuite - Enum in com.squareup.okhttp
cipherSuite() - Method in class com.squareup.okhttp.Handshake
Returns a cipher suite name like "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA".
cipherSuites(CipherSuite...) - Method in class com.squareup.okhttp.ConnectionSpec.Builder
 
cipherSuites(String...) - Method in class com.squareup.okhttp.ConnectionSpec.Builder
 
cipherSuites() - Method in class com.squareup.okhttp.ConnectionSpec
Returns the cipher suites to use for a connection.
CLEARTEXT - Static variable in class com.squareup.okhttp.ConnectionSpec
Unencrypted, unauthenticated connections for http: URLs.
clone() - Method in class com.squareup.okhttp.OkHttpClient
Returns a shallow copy of this OkHttpClient.
close() - Method in class com.squareup.okhttp.Cache
 
close() - Method in class com.squareup.okhttp.ResponseBody
 
code(int) - Method in class com.squareup.okhttp.Response.Builder
 
code() - Method in class com.squareup.okhttp.Response
Returns the HTTP status code.
com.squareup.okhttp - package com.squareup.okhttp
 
COMPATIBLE_TLS - Static variable in class com.squareup.okhttp.ConnectionSpec
A backwards-compatible fallback connection for interop with obsolete servers.
Connection - Interface in com.squareup.okhttp
The sockets and streams of an HTTP, HTTPS, or HTTPS+SPDY connection.
connection() - Method in interface com.squareup.okhttp.Interceptor.Chain
 
ConnectionPool - Class in com.squareup.okhttp
Manages reuse of HTTP and SPDY connections for reduced network latency.
ConnectionPool(int, long) - Constructor for class com.squareup.okhttp.ConnectionPool
 
ConnectionPool(int, long, TimeUnit) - Constructor for class com.squareup.okhttp.ConnectionPool
 
ConnectionSpec - Class in com.squareup.okhttp
Specifies configuration for the socket connection that HTTP traffic travels through.
ConnectionSpec.Builder - Class in com.squareup.okhttp
 
contentLength() - Method in class com.squareup.okhttp.RequestBody
Returns the number of bytes that will be written to out in a call to RequestBody.writeTo(okio.BufferedSink), or -1 if that count is unknown.
contentLength() - Method in class com.squareup.okhttp.ResponseBody
Returns the number of bytes in that will returned by ResponseBody.bytes(), or ResponseBody.byteStream(), or -1 if unknown.
contentType() - Method in class com.squareup.okhttp.RequestBody
Returns the Content-Type header for this body.
contentType() - Method in class com.squareup.okhttp.ResponseBody
 
create(MediaType, String) - Static method in class com.squareup.okhttp.RequestBody
Returns a new request body that transmits content.
create(MediaType, ByteString) - Static method in class com.squareup.okhttp.RequestBody
Returns a new request body that transmits content.
create(MediaType, byte[]) - Static method in class com.squareup.okhttp.RequestBody
Returns a new request body that transmits content.
create(MediaType, byte[], int, int) - Static method in class com.squareup.okhttp.RequestBody
Returns a new request body that transmits content.
create(MediaType, File) - Static method in class com.squareup.okhttp.RequestBody
Returns a new request body that transmits the content of file.
create(MediaType, String) - Static method in class com.squareup.okhttp.ResponseBody
Returns a new response body that transmits content.
create(MediaType, byte[]) - Static method in class com.squareup.okhttp.ResponseBody
Returns a new response body that transmits content.
create(MediaType, long, BufferedSource) - Static method in class com.squareup.okhttp.ResponseBody
Returns a new response body that transmits content.
Credentials - Class in com.squareup.okhttp
Factory for HTTP authorization credentials.

D

DEFAULT - Static variable in class com.squareup.okhttp.CertificatePinner
 
defaultPort(String) - Static method in class com.squareup.okhttp.HttpUrl
Returns 80 if scheme.equals("http"), 443 if scheme.equals("https") and -1 otherwise.
delete() - Method in class com.squareup.okhttp.Cache
Closes the cache and deletes all of its stored values.
delete(RequestBody) - Method in class com.squareup.okhttp.Request.Builder
 
delete() - Method in class com.squareup.okhttp.Request.Builder
 
DIGEST - Static variable in class com.squareup.okhttp.MultipartBuilder
This type is syntactically identical to "multipart/mixed", but the semantics are different.
Dispatcher - Class in com.squareup.okhttp
Policy on when async requests are executed.
Dispatcher(ExecutorService) - Constructor for class com.squareup.okhttp.Dispatcher
 
Dispatcher() - Constructor for class com.squareup.okhttp.Dispatcher
 
Dns - Interface in com.squareup.okhttp
A domain name service that resolves IP addresses for host names.

E

encodedFragment(String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
encodedFragment() - Method in class com.squareup.okhttp.HttpUrl
 
encodedPassword(String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
encodedPassword() - Method in class com.squareup.okhttp.HttpUrl
Returns the password, or an empty string if none is set.
encodedPath(String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
encodedPath() - Method in class com.squareup.okhttp.HttpUrl
Returns the entire path of this URL, encoded for use in HTTP resource resolution.
encodedPathSegments() - Method in class com.squareup.okhttp.HttpUrl
 
encodedQuery(String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
encodedQuery() - Method in class com.squareup.okhttp.HttpUrl
Returns the query of this URL, encoded for use in HTTP resource resolution.
encodedUsername(String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
encodedUsername() - Method in class com.squareup.okhttp.HttpUrl
Returns the username, or an empty string if none is set.
enqueue(Callback) - Method in class com.squareup.okhttp.Call
Schedules the request to be executed at some point in the future.
equals(Object) - Method in class com.squareup.okhttp.Address
 
equals(Object) - Method in class com.squareup.okhttp.Challenge
 
equals(Object) - Method in class com.squareup.okhttp.ConnectionSpec
 
equals(Object) - Method in class com.squareup.okhttp.Handshake
 
equals(Object) - Method in class com.squareup.okhttp.HttpUrl
 
equals(Object) - Method in class com.squareup.okhttp.MediaType
 
equals(Object) - Method in class com.squareup.okhttp.Route
 
evictAll() - Method in class com.squareup.okhttp.Cache
Deletes all values stored in the cache.
evictAll() - Method in class com.squareup.okhttp.ConnectionPool
Close and remove all idle connections in the pool.
execute() - Method in class com.squareup.okhttp.Call
Invokes the request immediately, and blocks until the response can be processed or is in error.

F

flush() - Method in class com.squareup.okhttp.Cache
 
FORCE_CACHE - Static variable in class com.squareup.okhttp.CacheControl
Cache control request directives that uses the cache only, even if the cached response is stale.
FORCE_NETWORK - Static variable in class com.squareup.okhttp.CacheControl
Cache control request directives that require network validation of responses.
forJavaName(String) - Static method in enum com.squareup.okhttp.CipherSuite
 
forJavaName(String) - Static method in enum com.squareup.okhttp.TlsVersion
 
FORM - Static variable in class com.squareup.okhttp.MultipartBuilder
The media-type multipart/form-data follows the rules of all multipart MIME data streams as outlined in RFC 2046.
FormEncodingBuilder - Class in com.squareup.okhttp
Fluent API to build HTML 2.0-compliant form data.
FormEncodingBuilder() - Constructor for class com.squareup.okhttp.FormEncodingBuilder
 
fragment(String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
fragment() - Method in class com.squareup.okhttp.HttpUrl
 

G

get(SSLSession) - Static method in class com.squareup.okhttp.Handshake
 
get(String, List<Certificate>, List<Certificate>) - Static method in class com.squareup.okhttp.Handshake
 
get(String) - Method in class com.squareup.okhttp.Headers.Builder
Equivalent to build().get(name), but potentially faster.
get(String) - Method in class com.squareup.okhttp.Headers
Returns the last value corresponding to the specified field, or null.
get(URL) - Static method in class com.squareup.okhttp.HttpUrl
Returns an HttpUrl for url if its protocol is http or https, or null if it has any other protocol.
get(URI) - Static method in class com.squareup.okhttp.HttpUrl
 
get(String) - Static method in enum com.squareup.okhttp.Protocol
Returns the protocol identified by protocol.
get() - Method in class com.squareup.okhttp.Request.Builder
 
getAddress() - Method in class com.squareup.okhttp.Route
 
getAuthenticator() - Method in class com.squareup.okhttp.Address
Returns the client's authenticator.
getAuthenticator() - Method in class com.squareup.okhttp.OkHttpClient
 
getCache() - Method in class com.squareup.okhttp.OkHttpClient
 
getCertificatePinner() - Method in class com.squareup.okhttp.Address
Returns this address's certificate pinner, or null if this is not an HTTPS address.
getCertificatePinner() - Method in class com.squareup.okhttp.OkHttpClient
 
getConnectionCount() - Method in class com.squareup.okhttp.ConnectionPool
Returns total number of connections in the pool.
getConnectionPool() - Method in class com.squareup.okhttp.OkHttpClient
 
getConnectionSpecs() - Method in class com.squareup.okhttp.Address
 
getConnectionSpecs() - Method in class com.squareup.okhttp.OkHttpClient
 
getConnectTimeout() - Method in class com.squareup.okhttp.OkHttpClient
Default connect timeout (in milliseconds).
getCookieHandler() - Method in class com.squareup.okhttp.OkHttpClient
 
getDate(String) - Method in class com.squareup.okhttp.Headers
Returns the last value corresponding to the specified field parsed as an HTTP date, or null if either the field is absent or cannot be parsed as a date.
getDefault() - Static method in class com.squareup.okhttp.ConnectionPool
 
getDirectory() - Method in class com.squareup.okhttp.Cache
 
getDispatcher() - Method in class com.squareup.okhttp.OkHttpClient
 
getDns() - Method in class com.squareup.okhttp.Address
Returns the service that will be used to resolve IP addresses for hostnames.
getDns() - Method in class com.squareup.okhttp.OkHttpClient
 
getExecutorService() - Method in class com.squareup.okhttp.Dispatcher
 
getFollowRedirects() - Method in class com.squareup.okhttp.OkHttpClient
 
getFollowSslRedirects() - Method in class com.squareup.okhttp.OkHttpClient
 
getHandshake() - Method in interface com.squareup.okhttp.Connection
 
getHitCount() - Method in class com.squareup.okhttp.Cache
 
getHostnameVerifier() - Method in class com.squareup.okhttp.Address
Returns the hostname verifier, or null if this is not an HTTPS address.
getHostnameVerifier() - Method in class com.squareup.okhttp.OkHttpClient
 
getHttpConnectionCount() - Method in class com.squareup.okhttp.ConnectionPool
Returns total number of http connections in the pool.
getIdleConnectionCount() - Method in class com.squareup.okhttp.ConnectionPool
Returns the number of idle connections in the pool.
getMaxRequests() - Method in class com.squareup.okhttp.Dispatcher
 
getMaxRequestsPerHost() - Method in class com.squareup.okhttp.Dispatcher
 
getMaxSize() - Method in class com.squareup.okhttp.Cache
 
getMultiplexedConnectionCount() - Method in class com.squareup.okhttp.ConnectionPool
Returns total number of multiplexed connections in the pool.
getNetworkCount() - Method in class com.squareup.okhttp.Cache
 
getProtocol() - Method in interface com.squareup.okhttp.Connection
Returns the protocol negotiated by this connection, or Protocol.HTTP_1_1 if no protocol has been negotiated.
getProtocols() - Method in class com.squareup.okhttp.Address
Returns the protocols the client supports.
getProtocols() - Method in class com.squareup.okhttp.OkHttpClient
 
getProxy() - Method in class com.squareup.okhttp.Address
Returns this address's explicitly-specified HTTP proxy, or null to delegate to the proxy selector.
getProxy() - Method in class com.squareup.okhttp.OkHttpClient
 
getProxy() - Method in class com.squareup.okhttp.Route
Returns the Proxy of this route.
getProxySelector() - Method in class com.squareup.okhttp.Address
Returns this address's proxy selector.
getProxySelector() - Method in class com.squareup.okhttp.OkHttpClient
 
getQueuedCallCount() - Method in class com.squareup.okhttp.Dispatcher
 
getReadTimeout() - Method in class com.squareup.okhttp.OkHttpClient
Default read timeout (in milliseconds).
getRealm() - Method in class com.squareup.okhttp.Challenge
Returns the protection space.
getRequestCount() - Method in class com.squareup.okhttp.Cache
 
getRetryOnConnectionFailure() - Method in class com.squareup.okhttp.OkHttpClient
 
getRoute() - Method in interface com.squareup.okhttp.Connection
Returns the route used by this connection.
getRunningCallCount() - Method in class com.squareup.okhttp.Dispatcher
 
getScheme() - Method in class com.squareup.okhttp.Challenge
Returns the authentication scheme, like Basic.
getSize() - Method in class com.squareup.okhttp.Cache
 
getSocket() - Method in interface com.squareup.okhttp.Connection
Returns the socket that this connection uses, or null if the connection is not currently connected.
getSocketAddress() - Method in class com.squareup.okhttp.Route
 
getSocketFactory() - Method in class com.squareup.okhttp.Address
Returns the socket factory for new connections.
getSocketFactory() - Method in class com.squareup.okhttp.OkHttpClient
 
getSpdyConnectionCount() - Method in class com.squareup.okhttp.ConnectionPool
getSslSocketFactory() - Method in class com.squareup.okhttp.Address
Returns the SSL socket factory, or null if this is not an HTTPS address.
getSslSocketFactory() - Method in class com.squareup.okhttp.OkHttpClient
 
getUriHost() - Method in class com.squareup.okhttp.Address
Deprecated.
prefer address.url().host().
getUriPort() - Method in class com.squareup.okhttp.Address
Deprecated.
prefer address.url().port().
getWriteAbortCount() - Method in class com.squareup.okhttp.Cache
 
getWriteSuccessCount() - Method in class com.squareup.okhttp.Cache
 
getWriteTimeout() - Method in class com.squareup.okhttp.OkHttpClient
Default write timeout (in milliseconds).

H

Handshake - Class in com.squareup.okhttp
A record of a TLS handshake.
handshake(Handshake) - Method in class com.squareup.okhttp.Response.Builder
 
handshake() - Method in class com.squareup.okhttp.Response
Returns the TLS handshake of the connection that carried this response, or null if the response was received without TLS.
hashCode() - Method in class com.squareup.okhttp.Address
 
hashCode() - Method in class com.squareup.okhttp.Challenge
 
hashCode() - Method in class com.squareup.okhttp.ConnectionSpec
 
hashCode() - Method in class com.squareup.okhttp.Handshake
 
hashCode() - Method in class com.squareup.okhttp.HttpUrl
 
hashCode() - Method in class com.squareup.okhttp.MediaType
 
hashCode() - Method in class com.squareup.okhttp.Route
 
head() - Method in class com.squareup.okhttp.Request.Builder
 
header(String, String) - Method in class com.squareup.okhttp.Request.Builder
Sets the header named name to value.
header(String) - Method in class com.squareup.okhttp.Request
 
header(String, String) - Method in class com.squareup.okhttp.Response.Builder
Sets the header named name to value.
header(String) - Method in class com.squareup.okhttp.Response
 
header(String, String) - Method in class com.squareup.okhttp.Response
 
Headers - Class in com.squareup.okhttp
The header fields of a single HTTP message.
headers(Headers) - Method in class com.squareup.okhttp.Request.Builder
Removes all headers on this builder and adds headers.
headers() - Method in class com.squareup.okhttp.Request
 
headers(String) - Method in class com.squareup.okhttp.Request
 
headers(Headers) - Method in class com.squareup.okhttp.Response.Builder
Removes all headers on this builder and adds headers.
headers(String) - Method in class com.squareup.okhttp.Response
 
headers() - Method in class com.squareup.okhttp.Response
 
Headers.Builder - Class in com.squareup.okhttp
 
host(String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
host() - Method in class com.squareup.okhttp.HttpUrl
Returns the host address suitable for use with InetAddress.getAllByName(String).
HttpUrl - Class in com.squareup.okhttp
A uniform resource locator (URL) with a scheme of either http or https.
httpUrl() - Method in class com.squareup.okhttp.Request
 
HttpUrl.Builder - Class in com.squareup.okhttp
 

I

initialize() - Method in class com.squareup.okhttp.Cache
Initialize the cache.
intercept(Interceptor.Chain) - Method in interface com.squareup.okhttp.Interceptor
 
Interceptor - Interface in com.squareup.okhttp
Observes, modifies, and potentially short-circuits requests going out and the corresponding requests coming back in.
Interceptor.Chain - Interface in com.squareup.okhttp
 
interceptors() - Method in class com.squareup.okhttp.OkHttpClient
Returns a modifiable list of interceptors that observe the full span of each call: from before the connection is established (if any) until after the response source is selected (either the origin server, cache, or both).
isCanceled() - Method in class com.squareup.okhttp.Call
 
isClosed() - Method in class com.squareup.okhttp.Cache
 
isCompatible(SSLSocket) - Method in class com.squareup.okhttp.ConnectionSpec
Returns true if the socket, as currently configured, supports this connection spec.
isExecuted() - Method in class com.squareup.okhttp.Call
Returns true if this call has been either executed or enqueued.
isHttps() - Method in class com.squareup.okhttp.HttpUrl
 
isHttps() - Method in class com.squareup.okhttp.Request
 
isPrivate() - Method in class com.squareup.okhttp.CacheControl
 
isPublic() - Method in class com.squareup.okhttp.CacheControl
 
isRedirect() - Method in class com.squareup.okhttp.Response
Returns true if this response redirects to another resource.
isSuccessful() - Method in class com.squareup.okhttp.Response
Returns true if the code is in [200..300), which means the request was successfully received, understood, and accepted.
isTls() - Method in class com.squareup.okhttp.ConnectionSpec
 

J

javaName() - Method in enum com.squareup.okhttp.TlsVersion
 

L

localCertificates() - Method in class com.squareup.okhttp.Handshake
Returns a possibly-empty list of certificates that identify this peer.
localPrincipal() - Method in class com.squareup.okhttp.Handshake
Returns the local principle, or null if this peer is anonymous.
lookup(String) - Method in interface com.squareup.okhttp.Dns
Returns the IP addresses of hostname, in the order they will be attempted by OkHttp.

M

maxAge(int, TimeUnit) - Method in class com.squareup.okhttp.CacheControl.Builder
Sets the maximum age of a cached response.
maxAgeSeconds() - Method in class com.squareup.okhttp.CacheControl
The duration past the response's served date that it can be served without validation.
maxStale(int, TimeUnit) - Method in class com.squareup.okhttp.CacheControl.Builder
Accept cached responses that have exceeded their freshness lifetime by up to maxStale.
maxStaleSeconds() - Method in class com.squareup.okhttp.CacheControl
 
MediaType - Class in com.squareup.okhttp
An RFC 2045 Media Type, appropriate to describe the content type of an HTTP request or response body.
message(String) - Method in class com.squareup.okhttp.Response.Builder
 
message() - Method in class com.squareup.okhttp.Response
Returns the HTTP status message or null if it is unknown.
method(String, RequestBody) - Method in class com.squareup.okhttp.Request.Builder
 
method() - Method in class com.squareup.okhttp.Request
 
minFresh(int, TimeUnit) - Method in class com.squareup.okhttp.CacheControl.Builder
Sets the minimum number of seconds that a response will continue to be fresh for.
minFreshSeconds() - Method in class com.squareup.okhttp.CacheControl
 
MIXED - Static variable in class com.squareup.okhttp.MultipartBuilder
The "mixed" subtype of "multipart" is intended for use when the body parts are independent and need to be bundled in a particular order.
MODERN_TLS - Static variable in class com.squareup.okhttp.ConnectionSpec
A modern TLS connection with extensions like SNI and ALPN available.
MultipartBuilder - Class in com.squareup.okhttp
Fluent API to build RFC 2387-compliant request bodies.
MultipartBuilder() - Constructor for class com.squareup.okhttp.MultipartBuilder
Creates a new multipart builder that uses a random boundary token.
MultipartBuilder(String) - Constructor for class com.squareup.okhttp.MultipartBuilder
Creates a new multipart builder that uses boundary to separate parts.
mustRevalidate() - Method in class com.squareup.okhttp.CacheControl
 

N

name(int) - Method in class com.squareup.okhttp.Headers
Returns the field at position or null if that is out of range.
names() - Method in class com.squareup.okhttp.Headers
Returns an immutable case-insensitive set of header names.
networkInterceptors() - Method in class com.squareup.okhttp.OkHttpClient
Returns a modifiable list of interceptors that observe a single network request and response.
networkResponse(Response) - Method in class com.squareup.okhttp.Response.Builder
 
networkResponse() - Method in class com.squareup.okhttp.Response
Returns the raw response received from the network.
newBuilder() - Method in class com.squareup.okhttp.Headers
 
newBuilder() - Method in class com.squareup.okhttp.HttpUrl
 
newBuilder() - Method in class com.squareup.okhttp.Request
 
newBuilder() - Method in class com.squareup.okhttp.Response
 
newCall(Request) - Method in class com.squareup.okhttp.OkHttpClient
Prepares the request to be executed at some point in the future.
noCache() - Method in class com.squareup.okhttp.CacheControl.Builder
Don't accept an unvalidated cached response.
noCache() - Method in class com.squareup.okhttp.CacheControl
In a response, this field's name "no-cache" is misleading.
noStore() - Method in class com.squareup.okhttp.CacheControl.Builder
Don't store the server's response in any cache.
noStore() - Method in class com.squareup.okhttp.CacheControl
If true, this response should not be cached.
noTransform() - Method in class com.squareup.okhttp.CacheControl.Builder
Don't accept a transformed response.
noTransform() - Method in class com.squareup.okhttp.CacheControl
 

O

of(String...) - Static method in class com.squareup.okhttp.Headers
Returns headers for the alternating header names and values.
of(Map<String, String>) - Static method in class com.squareup.okhttp.Headers
Returns headers for the header names and values in the Map.
OkHttpClient - Class in com.squareup.okhttp
Configures and creates HTTP connections.
OkHttpClient() - Constructor for class com.squareup.okhttp.OkHttpClient
 
onFailure(Request, IOException) - Method in interface com.squareup.okhttp.Callback
Called when the request could not be executed due to cancellation, a connectivity problem or timeout.
onlyIfCached() - Method in class com.squareup.okhttp.CacheControl.Builder
Only accept the response if it is in the cache.
onlyIfCached() - Method in class com.squareup.okhttp.CacheControl
This field's name "only-if-cached" is misleading.
onResponse(Response) - Method in interface com.squareup.okhttp.Callback
Called when the HTTP response was successfully returned by the remote server.

P

PARALLEL - Static variable in class com.squareup.okhttp.MultipartBuilder
This type is syntactically identical to "multipart/mixed", but the semantics are different.
parse(Headers) - Static method in class com.squareup.okhttp.CacheControl
Returns the cache directives of headers.
parse(String) - Static method in class com.squareup.okhttp.HttpUrl
Returns a new HttpUrl representing url if it is a well-formed HTTP or HTTPS URL, or null if it isn't.
parse(String) - Static method in class com.squareup.okhttp.MediaType
Returns a media type for string, or null if string is not a well-formed media type.
password(String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
password() - Method in class com.squareup.okhttp.HttpUrl
Returns the decoded password, or an empty string if none is present.
patch(RequestBody) - Method in class com.squareup.okhttp.Request.Builder
 
pathSegments() - Method in class com.squareup.okhttp.HttpUrl
 
pathSize() - Method in class com.squareup.okhttp.HttpUrl
 
peerCertificates() - Method in class com.squareup.okhttp.Handshake
Returns a possibly-empty list of certificates that identify the remote peer.
peerPrincipal() - Method in class com.squareup.okhttp.Handshake
Returns the remote peer's principle, or null if that peer is anonymous.
pin(Certificate) - Static method in class com.squareup.okhttp.CertificatePinner
Returns the SHA-1 of certificate's public key.
port(int) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
port() - Method in class com.squareup.okhttp.HttpUrl
Returns the explicitly-specified port if one was provided, or the default port for this URL's scheme.
post(RequestBody) - Method in class com.squareup.okhttp.Request.Builder
 
priorResponse(Response) - Method in class com.squareup.okhttp.Response.Builder
 
priorResponse() - Method in class com.squareup.okhttp.Response
Returns the response for the HTTP redirect or authorization challenge that triggered this response, or null if this response wasn't triggered by an automatic retry.
proceed(Request) - Method in interface com.squareup.okhttp.Interceptor.Chain
 
Protocol - Enum in com.squareup.okhttp
Protocols that OkHttp implements for ALPN selection.
protocol(Protocol) - Method in class com.squareup.okhttp.Response.Builder
 
protocol() - Method in class com.squareup.okhttp.Response
Returns the HTTP protocol, such as Protocol.HTTP_1_1 or Protocol.HTTP_1_0.
put(RequestBody) - Method in class com.squareup.okhttp.Request.Builder
 

Q

query(String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
query() - Method in class com.squareup.okhttp.HttpUrl
 
queryParameter(String) - Method in class com.squareup.okhttp.HttpUrl
Returns the first query parameter named name decoded using UTF-8, or null if there is no such query parameter.
queryParameterName(int) - Method in class com.squareup.okhttp.HttpUrl
 
queryParameterNames() - Method in class com.squareup.okhttp.HttpUrl
 
queryParameterValue(int) - Method in class com.squareup.okhttp.HttpUrl
 
queryParameterValues(String) - Method in class com.squareup.okhttp.HttpUrl
 
querySize() - Method in class com.squareup.okhttp.HttpUrl
 

R

removeAll(String) - Method in class com.squareup.okhttp.Headers.Builder
 
removeAllEncodedQueryParameters(String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
removeAllQueryParameters(String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
removeHeader(String) - Method in class com.squareup.okhttp.Request.Builder
 
removeHeader(String) - Method in class com.squareup.okhttp.Response.Builder
 
removePathSegment(int) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
request() - Method in interface com.squareup.okhttp.Interceptor.Chain
 
Request - Class in com.squareup.okhttp
An HTTP request.
request(Request) - Method in class com.squareup.okhttp.Response.Builder
 
request() - Method in class com.squareup.okhttp.Response
The wire-level request that initiated this HTTP response.
Request.Builder - Class in com.squareup.okhttp
 
RequestBody - Class in com.squareup.okhttp
 
RequestBody() - Constructor for class com.squareup.okhttp.RequestBody
 
requiresTunnel() - Method in class com.squareup.okhttp.Route
Returns true if this route tunnels HTTPS through an HTTP proxy.
resolve(String) - Method in class com.squareup.okhttp.HttpUrl
Returns the URL that would be retrieved by following link from this URL.
Response - Class in com.squareup.okhttp
An HTTP response.
Response.Builder - Class in com.squareup.okhttp
 
ResponseBody - Class in com.squareup.okhttp
 
ResponseBody() - Constructor for class com.squareup.okhttp.ResponseBody
 
Route - Class in com.squareup.okhttp
The concrete route used by a connection to reach an abstract origin server.
Route(Address, Proxy, InetSocketAddress) - Constructor for class com.squareup.okhttp.Route
 

S

scheme(String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
scheme() - Method in class com.squareup.okhttp.HttpUrl
Returns either "http" or "https".
set(String, String) - Method in class com.squareup.okhttp.Headers.Builder
Set a field with the specified value.
setAuthenticator(Authenticator) - Method in class com.squareup.okhttp.OkHttpClient
Sets the authenticator used to respond to challenges from the remote web server or proxy server.
setCache(Cache) - Method in class com.squareup.okhttp.OkHttpClient
 
setCertificatePinner(CertificatePinner) - Method in class com.squareup.okhttp.OkHttpClient
Sets the certificate pinner that constrains which certificates are trusted.
setConnectionPool(ConnectionPool) - Method in class com.squareup.okhttp.OkHttpClient
Sets the connection pool used to recycle HTTP and HTTPS connections.
setConnectionSpecs(List<ConnectionSpec>) - Method in class com.squareup.okhttp.OkHttpClient
 
setConnectTimeout(long, TimeUnit) - Method in class com.squareup.okhttp.OkHttpClient
Sets the default connect timeout for new connections.
setCookieHandler(CookieHandler) - Method in class com.squareup.okhttp.OkHttpClient
Sets the cookie handler to be used to read outgoing cookies and write incoming cookies.
setDispatcher(Dispatcher) - Method in class com.squareup.okhttp.OkHttpClient
Sets the dispatcher used to set policy and execute asynchronous requests.
setDns(Dns) - Method in class com.squareup.okhttp.OkHttpClient
Sets the DNS service used to lookup IP addresses for hostnames.
setEncodedPathSegment(int, String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
setEncodedQueryParameter(String, String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
setFollowRedirects(boolean) - Method in class com.squareup.okhttp.OkHttpClient
Configure this client to follow redirects.
setFollowSslRedirects(boolean) - Method in class com.squareup.okhttp.OkHttpClient
Configure this client to follow redirects from HTTPS to HTTP and from HTTP to HTTPS.
setHostnameVerifier(HostnameVerifier) - Method in class com.squareup.okhttp.OkHttpClient
Sets the verifier used to confirm that response certificates apply to requested hostnames for HTTPS connections.
setMaxRequests(int) - Method in class com.squareup.okhttp.Dispatcher
Set the maximum number of requests to execute concurrently.
setMaxRequestsPerHost(int) - Method in class com.squareup.okhttp.Dispatcher
Set the maximum number of requests for each host to execute concurrently.
setPathSegment(int, String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
setProtocols(List<Protocol>) - Method in class com.squareup.okhttp.OkHttpClient
Configure the protocols used by this client to communicate with remote servers.
setProxy(Proxy) - Method in class com.squareup.okhttp.OkHttpClient
Sets the HTTP proxy that will be used by connections created by this client.
setProxySelector(ProxySelector) - Method in class com.squareup.okhttp.OkHttpClient
Sets the proxy selection policy to be used if no proxy is specified explicitly.
setQueryParameter(String, String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
setReadTimeout(long, TimeUnit) - Method in class com.squareup.okhttp.OkHttpClient
Sets the default read timeout for new connections.
setRetryOnConnectionFailure(boolean) - Method in class com.squareup.okhttp.OkHttpClient
Configure this client to retry or not when a connectivity problem is encountered.
setSocketFactory(SocketFactory) - Method in class com.squareup.okhttp.OkHttpClient
Sets the socket factory used to create connections.
setSslSocketFactory(SSLSocketFactory) - Method in class com.squareup.okhttp.OkHttpClient
Sets the socket factory used to secure HTTPS connections.
setWriteTimeout(long, TimeUnit) - Method in class com.squareup.okhttp.OkHttpClient
Sets the default write timeout for new connections.
size() - Method in class com.squareup.okhttp.Headers
Returns the number of field values.
sMaxAgeSeconds() - Method in class com.squareup.okhttp.CacheControl
The "s-maxage" directive is the max age for shared caches.
source() - Method in class com.squareup.okhttp.ResponseBody
 
string() - Method in class com.squareup.okhttp.ResponseBody
Returns the response as a string decoded with the charset of the Content-Type header.
subtype() - Method in class com.squareup.okhttp.MediaType
Returns a specific media subtype, such as "plain" or "png", "mpeg", "mp4" or "xml".
supportsTlsExtensions(boolean) - Method in class com.squareup.okhttp.ConnectionSpec.Builder
 
supportsTlsExtensions() - Method in class com.squareup.okhttp.ConnectionSpec
 
SYSTEM - Static variable in interface com.squareup.okhttp.Dns
A DNS that uses InetAddress.getAllByName(java.lang.String) to ask the underlying operating system to lookup IP addresses.

T

tag(Object) - Method in class com.squareup.okhttp.Request.Builder
Attaches tag to the request.
tag() - Method in class com.squareup.okhttp.Request
 
TlsVersion - Enum in com.squareup.okhttp
Versions of TLS that can be offered when negotiating a secure socket.
tlsVersions(TlsVersion...) - Method in class com.squareup.okhttp.ConnectionSpec.Builder
 
tlsVersions(String...) - Method in class com.squareup.okhttp.ConnectionSpec.Builder
 
tlsVersions() - Method in class com.squareup.okhttp.ConnectionSpec
Returns the TLS versions to use when negotiating a connection.
toMultimap() - Method in class com.squareup.okhttp.Headers
 
toString() - Method in class com.squareup.okhttp.CacheControl
 
toString() - Method in class com.squareup.okhttp.Challenge
 
toString() - Method in class com.squareup.okhttp.ConnectionSpec
 
toString() - Method in class com.squareup.okhttp.Headers
 
toString() - Method in class com.squareup.okhttp.HttpUrl.Builder
 
toString() - Method in class com.squareup.okhttp.HttpUrl
 
toString() - Method in class com.squareup.okhttp.MediaType
Returns the encoded media type, like "text/plain; charset=utf-8", appropriate for use in a Content-Type header.
toString() - Method in enum com.squareup.okhttp.Protocol
Returns the string used to identify this protocol for ALPN, like "http/1.1", "spdy/3.1" or "h2".
toString() - Method in class com.squareup.okhttp.Request
 
toString() - Method in class com.squareup.okhttp.Response
 
type() - Method in class com.squareup.okhttp.MediaType
Returns the high-level media type, such as "text", "image", "audio", "video", or "application".
type(MediaType) - Method in class com.squareup.okhttp.MultipartBuilder
Set the MIME type.

U

uri() - Method in class com.squareup.okhttp.HttpUrl
Returns this URL as a java.net.URI.
uri() - Method in class com.squareup.okhttp.Request
 
url() - Method in class com.squareup.okhttp.Address
Returns a URL with the hostname and port of the origin server.
url() - Method in class com.squareup.okhttp.HttpUrl
Returns this URL as a java.net.URL.
url(HttpUrl) - Method in class com.squareup.okhttp.Request.Builder
 
url(String) - Method in class com.squareup.okhttp.Request.Builder
Sets the URL target of this request.
url(URL) - Method in class com.squareup.okhttp.Request.Builder
Sets the URL target of this request.
url() - Method in class com.squareup.okhttp.Request
 
urls() - Method in class com.squareup.okhttp.Cache
Returns an iterator over the URLs in this cache.
urlString() - Method in class com.squareup.okhttp.Request
 
username(String) - Method in class com.squareup.okhttp.HttpUrl.Builder
 
username() - Method in class com.squareup.okhttp.HttpUrl
 

V

value(int) - Method in class com.squareup.okhttp.Headers
Returns the value at index or null if that is out of range.
valueOf(String) - Static method in enum com.squareup.okhttp.CipherSuite
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum com.squareup.okhttp.Protocol
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum com.squareup.okhttp.TlsVersion
Returns the enum constant of this type with the specified name.
values() - Static method in enum com.squareup.okhttp.CipherSuite
Returns an array containing the constants of this enum type, in the order they are declared.
values(String) - Method in class com.squareup.okhttp.Headers
Returns an immutable list of the header values for name.
values() - Static method in enum com.squareup.okhttp.Protocol
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum com.squareup.okhttp.TlsVersion
Returns an array containing the constants of this enum type, in the order they are declared.

W

writeTo(BufferedSink) - Method in class com.squareup.okhttp.RequestBody
Writes the content of this request to out.
A B C D E F G H I J L M N O P Q R S T U V W 
Skip navigation links

Copyright © 2016. All Rights Reserved.