# OkHttp

> A meticulous HTTP client for the JVM, Android, and GraalVM

Source: https://talira.ai/catalog/okhttp-5e4hqag3
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / http clients](https://talira.ai/categories/libraries/http-clients), [languages / java](https://talira.ai/categories/languages/java), [languages / kotlin](https://talira.ai/categories/languages/kotlin)
- Licence: Apache-2.0[^1][^2]
- Pricing: Free and open source[^1]
- Pricing notes: Free and open source.
- Free tier: yes[^1]

OkHttp is an HTTP client for [Java](https://talira.ai/catalog/java-4ptdc599.md), [Kotlin](https://talira.ai/catalog/kotlin-vrmcrayv.md) and Android that is efficient by default: HTTP/2 lets all requests to the same host share a socket, connection pooling cuts latency when HTTP/2 isn't available, transparent GZIP shrinks downloads, and response caching skips the network for repeat requests. It recovers silently from common connection problems, tries a service's alternate IP addresses when the first fails, and supports TLS 1.3, ALPN and certificate pinning. Its request and response API uses fluent builders and immutable objects, with synchronous calls and asynchronous calls with callbacks, interceptors, WebSockets and server-sent events, and it follows the HTTP RFCs rather than being configurable for broken servers. MockWebServer, from the same project, scripts HTTP responses for tests, and [Retrofit](https://talira.ai/catalog/retrofit-q4egfen2.md) builds on OkHttp.

## Links

- Website: https://lysine.dev/okhttp/
- GitHub: https://github.com/lysine-dev/okhttp
- Docs: https://lysine.dev/okhttp/

## Problems it solves

- an efficient HTTP client for my Android app
- make HTTP requests from Java or Kotlin with connection pooling and HTTP/2
- pin TLS certificates for my app's API connections
- cache HTTP responses on Android to avoid repeat network requests
- log or modify every HTTP request and response my app sends with interceptors
- mock HTTP server responses in JVM unit tests
- retry against alternate IP addresses when a server connection fails
- WebSockets and server-sent events client for Android or the JVM

## Features

- HTTP/2 with shared sockets per host
- connection pooling
- transparent GZIP
- response caching
- recovery from common connection problems and alternate IP addresses
- TLS 1.3, ALPN and certificate pinning
- synchronous and asynchronous calls
- interceptors
- WebSockets and server-sent events
- MockWebServer for tests
- GraalVM native image support
- Kotlin Multiplatform artifacts with a BOM

## Limitations

- Does not allow GET with a body.[^1]
- Cache is not an interface with alternative implementations.[^1]
- Works on Android 5.0+ (API level 21+) and Java 8+.[^1]

## Trust

Overall: 0.71 out of 1.
Signals: maintenance 1.00, adoption 0.93, momentum 0.74, community 1.00, backing 0.00, extensibility 0.00.

- last commit today
- 115 commits in the last 90 days
- 47.1k GitHub stars
- 367 contributors

## Alternatives

- [Ktor](https://talira.ai/catalog/ktor-xe69h8gc.md): Build asynchronous servers and clients in Kotlin
- [Retrofit](https://talira.ai/catalog/retrofit-q4egfen2.md): A type-safe HTTP client for Android and Java

## Sources

[^1]: https://lysine.dev/okhttp/ (checked 24 Nov 2026)
[^2]: https://github.com/lysine-dev/okhttp/blob/main/LICENSE.txt (checked 24 Nov 2026)
