square

square/okhttp

Kotlin Apache-2.0 Dev Tools

Square’s meticulous HTTP client for the JVM, Android, and GraalVM.

47k stars
9.3k forks
active
GitHub +6 / week

47k

Stars

9.3k

Forks

127

Open issues

100+

Contributors

AI Analysis

OkHttp is Square's production-grade HTTP client library for the JVM, Android, and GraalVM, designed for efficient network communication with modern protocol support (HTTP/2, TLS 1.3, WebSockets). It serves developers building Java/Kotlin applications and Android apps that require reliable, high-performance HTTP networking with built-in connection pooling, response caching, and transparent compression. Not a general-purpose networking library for beginners—it's for engineers building systems t...

Dev Tools Library Discovery value: 1/10
Documentation 8/10
Activity 9/10
Community 9/10
Code quality 7/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 9/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

http-client networking kotlin jvm android
Actively maintained Well documented Popular Niche/specialized use case Production ready
Deep Analysis · Based on README and public signals
3w ago

OkHttp: The de-facto JVM and Android HTTP client with 14 years of production hardening

OkHttp is a mature, production-grade HTTP client for JVM, Android, and GraalVM, built and maintained by Square. It handles HTTP/1.1, HTTP/2, WebSockets, and SSE with connection pooling, transparent GZIP, response caching, and robust TLS support. It is the foundational HTTP layer under Retrofit and is used by a vast portion of the Android app ecosystem. Its primary audience is Android developers and JVM backend/tooling engineers who need a reliable, spec-compliant HTTP client without rolling their own connection management.

Origin

Created in July 2012 by Square as a replacement for HttpURLConnection and Apache HttpClient on Android. Has evolved through major versions, currently at 5.x with Kotlin Multiplatform support, continuously tracking TLS ecosystem changes.

Growth

Growth was driven by Android ecosystem dominance — Retrofit's choice of OkHttp as its transport layer exposed millions of apps to it indirectly. Star growth has plateaued near 47k, reflecting a mature, ubiquitous library where new adoption is a given rather than a trend. Recent 7-day star gain of 9 reflects saturation, not decline.

In production

Widely documented in production at scale: used as the HTTP layer by Retrofit (43k+ stars), by Square's own payment infrastructure, and by the majority of Android applications published since 2014. Maven Central download counts are among the highest in the Android ecosystem. Multiple Fortune 500 companies indirectly depend on it via Retrofit or direct integration.

Code analysis
Architecture

Appears to follow a layered interceptor chain design, where each concern (caching, connection, retry, TLS) is a composable interceptor. Likely uses Okio for buffered I/O. Published as a Kotlin Multiplatform artifact targeting JVM and Android separately. Fluent builder API with immutable request/response objects is explicitly documented.

Tests

Not documented in README, but the project's maturity and Square's engineering culture suggest extensive test coverage. The README references a TLS compatibility history page and recipes, implying regression testing is taken seriously.

Maintenance

Last push on 2026-06-19, two days before the evaluation date — actively maintained. Version 5.4.0 is current on Maven Central. Active BOM support, ProGuard/R8 rules, and snapshot builds all indicate ongoing release engineering investment.

Honest verdict

ADOPT IF: you are building Android applications, JVM services that need robust HTTP with interceptor extensibility, or any project already using Retrofit. AVOID IF: you need maximum configurability with non-standard or RFC-violating server behavior, are targeting Kotlin/Native or JS platforms without JVM, or want zero external dependencies on JDK 11+ server apps. MONITOR IF: you are evaluating Ktor Client for a greenfield Kotlin Multiplatform project — OkHttp's KMP story is evolving but may not match Ktor's native platform breadth.

Independent dimensions

Mainstream potential

9/10

Technical importance

9/10

Adoption evidence

10/10

Risks
  • OkHttp's principled refusal to support non-RFC behavior (e.g., no GET with body) can be a hard blocker when integrating with poorly implemented third-party APIs.
  • Kotlin Multiplatform publishing (empty Maven `okhttp` artifact requiring explicit `-jvm` or `-android` selection) adds friction for Maven-based projects and may cause silent dependency issues.
  • The project depends on Okio and Kotlin stdlib, adding transitive dependency weight that may be undesirable in constrained environments.
  • TLS configuration is intentionally limited — teams needing fine-grained control over TLS session handling or custom trust chains may find the API surface insufficient.
  • Being a Square-maintained open source project, sustained long-term maintenance depends on Square's continued organizational investment, which has historically been strong but is not formally guaranteed.
Prediction

OkHttp will remain the dominant HTTP client for Android and a top choice on JVM for the foreseeable future, with slow but steady evolution toward deeper Kotlin Multiplatform coverage.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

Kotlin
99.3%
Java
0.6%
Shell
0.1%

Information

Language
Kotlin
License
Apache-2.0
Last updated
-55 min ago
Created
170mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Recent releases

No releases published yet.

Similar repos

square

square/okio

Okio is a modern I/O library for Android, Java, and Kotlin Multiplatform that...

9k Kotlin Dev Tools
liujingxing

liujingxing/rxhttp

RxHttp is a type-safe HTTP client library for Android built on OkHttp,...

3.8k Kotlin Mobile
square

square/retrofit

Retrofit is a type-safe HTTP client library for Android and Java that...

43.9k HTML Dev Tools
amitshekhariitbhu

amitshekhariitbhu/Fast-Android-Networking

Fast Android Networking Library is a comprehensive networking library for...

5.9k Java Mobile
http4k

http4k/http4k

http4k is a lightweight, functional HTTP toolkit for Kotlin that enables...

2.8k Kotlin Web Dev
vs. alternatives
Java HttpClient (java.net.http)

Built into JDK 11+, requiring no dependency, but lacks connection pooling sophistication, transparent GZIP, response caching, and the interceptor model. OkHttp is preferred where fine-grained control and Android compatibility matter; Java HttpClient suits minimal-dependency JDK 11+ server-side contexts.

Apache HttpClient 5

More configurable and permissive about non-standard HTTP behavior — explicitly the opposite of OkHttp's principled stance. Preferred in enterprise legacy contexts or where server-side quirks must be tolerated. OkHttp is more ergonomic and spec-correct by design.

Ktor Client

Kotlin-native multiplatform HTTP client from JetBrains. Targets Kotlin/JS and Kotlin/Native beyond JVM/Android, making it broader in platform scope. OkHttp is more battle-tested on Android and integrates more deeply with the existing Android/Retrofit ecosystem.

Retrofit (square/retrofit)

Not a direct competitor — Retrofit is a type-safe REST adapter that sits on top of OkHttp. They are complementary; Retrofit handles API declaration while OkHttp handles transport. Choosing Retrofit does not mean replacing OkHttp.

Fuel

A Kotlin HTTP client with a simpler API surface, aimed at reducing boilerplate. Far less adopted and battle-tested than OkHttp, and lacks the deep Android ecosystem integration. May appeal in pure-Kotlin coroutine-first projects but carries significantly less production validation.