- 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.
- 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
-
- 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
-
- contentLength() - Method in class com.squareup.okhttp.ResponseBody
-
- 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.
- 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
-
- getUriPort() - Method in class com.squareup.okhttp.Address
-
- 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).
- 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
-
- put(RequestBody) - Method in class com.squareup.okhttp.Request.Builder
-
- 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
-