Home

OkHttp

OkHttp is an open-source HTTP client library for Java and Android, originally developed by Square and now maintained by the open-source community. It provides a fast, efficient HTTP client designed for modern networks and mobile devices. OkHttp supports HTTP/2 and connection pooling, which reduces latency by sharing a single connection for multiple requests. It also includes transparent GZIP compression and response caching to reduce data usage and improve performance.

The library centers on a small API surface with core classes such as OkHttpClient, Request, Response, and

OkHttp is widely used as the networking layer in Android apps and in server-side Java projects, and

Call.
Requests
can
be
executed
synchronously
via
execute()
or
asynchronously
via
enqueue(Callback).
OkHttp’s
interceptor
mechanism
allows
monitoring,
rewriting
requests
and
responses,
and
implementing
features
such
as
retry
logic,
authentication,
or
logging.
The
client
supports
WebSocket
connections
and
is
capable
of
retries
and
timeouts
to
handle
transient
network
failures
gracefully.
it
is
commonly
paired
with
Retrofit
as
a
higher-level
HTTP
client.
It
adheres
to
modern
web
standards,
including
RFC-compliant
caching
and
support
for
HTTP/2
multiplexing.
The
project
is
released
under
the
Apache
License
2.0.