OkHttp is an HTTP client for the JVM, Android, and GraalVM that prioritizes efficiency and standards compliance.
OkHttp addresses the need for reliable, performant HTTP communication by implementing modern protocol features and recovery mechanisms. It supports HTTP/2 to multiplex requests over a single connection, connection pooling to reduce latency, transparent GZIP compression, and response caching to eliminate redundant network calls. When connectivity fails, the tool silently recovers from common problems and attempts alternate IP addresses, making it resilient in unreliable network conditions. It supports modern TLS features including TLS 1.3, ALPN, and certificate pinning, with fallback options for broader compatibility.
Developers should choose OkHttp if they need an HTTP client that adheres strictly to modern specifications rather than one designed for maximum configurability. The tool is well-suited for applications where standards compliance and predictable behavior matter more than working around buggy servers or testing invalid scenarios. The project explicitly avoids features like allowing GET requests with bodies or exposing the cache as a pluggable interface, reflecting a philosophy of principled design over extensive customization. It works on Android 5.0 and later and Java 8 and later, with minimal dependencies on Okio and the Kotlin standard library.
Development activity shows consistent attention to the evolving TLS ecosystem, with the maintainers tracking changes and adjusting the tool to improve both connectivity and security. The codebase emphasizes immutability and fluent builder patterns in its API design, supporting both synchronous blocking calls and asynchronous callbacks.