An efficient HTTP client for JVM, Android, and GraalVM with HTTP/2, connection pooling, caching, and modern TLS support.
OkHttp is an HTTP client library for the JVM, Android, and GraalVM, designed to make network communication efficient and reliable. It solves the problem of slow and unstable HTTP requests by providing built-in performance optimizations like HTTP/2 support, connection pooling, and response caching. It also handles network issues gracefully with automatic recovery and supports modern security standards like TLS 1.3.
Java and Kotlin developers building Android, server-side, or desktop applications that require robust HTTP networking. It's particularly valuable for teams needing a production-ready client with strong performance and standards compliance.
Developers choose OkHttp because it's efficient by default, follows modern HTTP specifications closely, and is backed by Square's meticulous engineering. Its combination of performance features, network resilience, and a clean, fluent API makes it a reliable choice over lower-level HTTP libraries.
Square’s meticulous HTTP client for the JVM, Android, and GraalVM.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Includes HTTP/2 support for socket sharing, connection pooling, and transparent GZIP compression to reduce latency and bandwidth, as highlighted in the README's efficiency features.
Silently recovers from common connection issues and attempts alternate IP addresses, ensuring reliability in unstable networks, which is explicitly mentioned for handling troublesome networks.
Supports TLS 1.3 and follows recent HTTP RFCs like RFC 9110, providing secure and spec-compliant interactions without compromising on correctness.
Offers a fluent builder pattern with immutable objects, supporting both synchronous and asynchronous calls easily, as shown in the example code snippets.
Does not allow non-standard behaviors like GET with a body, which can be problematic for older or non-compliant APIs, as admitted in the example limitations.
The response cache is not designed as an interface, preventing the use of custom caching implementations, limiting extensibility for advanced use cases.
Maven projects must manually select between okhttp-jvm and okhttp-android artifacts, adding configuration overhead compared to Gradle's automatic handling.