qmetrics.net

OkHttp

HTTP client for JVM, Android, and GraalVM

OkHttp screenshot

OkHttp is an HTTP client library tuned for efficient networking on Android, Java, and GraalVM native images. It offers synchronous and asynchronous call APIs with a fluent request builder.

Overview

OkHttp is an HTTP client for JVM applications, Android apps, and GraalVM native builds. It targets everyday application networking with defaults aimed at speed and resilience: HTTP/2 sharing on one host, connection pooling, transparent GZIP, and response caching for repeat requests.

When connections fail, it can retry against alternate IP addresses, which helps IPv4 and IPv6 deployments and redundant endpoints. TLS support includes modern options such as TLS 1.3, ALPN, and certificate pinning, with configurable fallback for broader connectivity. The public API uses immutable request and response objects with builder-style construction and supports both blocking calls and callback-based async execution.

The client follows contemporary HTTP specifications and deliberately limits exotic configuration, such as rejecting GET requests with bodies. Optional companion artifacts cover logging, Server-Sent Events, DNS over HTTPS, Brotli, coroutines, and TLS helpers. MockWebServer provides an in-project HTTP test double for basic client testing, though the project notes that heavy testing needs may outgrow it.

Android support starts at API level 21 and integrates with AndroidX Startup unless the app initializes OkHttp manually. Java 8+ and GraalVM native image builds are supported, with published JVM and Android Maven artifacts and Java 9 module boundaries on recent releases.

Key features

  • HTTP/2 and connection pooling
  • Response caching and GZIP
  • TLS 1.3, ALPN, and pinning
  • Sync and async request APIs
  • Alternate address connection retry
  • Kotlin Multiplatform publishing
  • MockWebServer test helper
  • GraalVM native image support

Use cases

  • Android app HTTP traffic
  • JVM backend HTTP calls
  • REST and JSON API clients
  • HTTP client integration tests
  • Native image CLI tools

Tags

Similar software

FastAPI

Python web framework for building APIs with type hints

FastAPI is a Python web framework for building APIs using standard type hints. It builds on Starlette and Pydantic and generates interactive OpenAPI documentation for the endpoints you define.

★ 105.1k⟳ 9 days agoMIT

NestJS

Progressive TypeScript framework for Node.js backends

Nest organizes Node server apps with modules, dependency injection, and first-party packages for auth, data, queues, and observability.

★ 77.2k⟳ todayMIT

gRPC

Cross-language remote procedure call framework

gRPC is an RPC framework that lets client and server programs communicate transparently and supports building connected, multi-language systems.

★ 45.5k⟳ todayApache-2.0

tRPC

End-to-end typesafe TypeScript APIs without code generation

tRPC helps teams define server procedures and call them from clients with full TypeScript types for inputs, outputs, and errors—no schemas or codegen step.

★ 40.9k⟳ todayMIT
Frameworks & PlatformsDesktop/CLI app

go-zero

Cloud-native Go microservices and RPC framework

go-zero is a Go web and RPC framework with code generation, built-in resilience middleware, and tooling aimed at stable high-traffic services.

★ 33.5k⟳ 9 days agoMIT

Hono

Lightweight web framework on Web Standards

Hono is a small web framework built on Web Standards that runs on Cloudflare Workers, Deno, Bun, Node.js, AWS Lambda, and other JavaScript runtimes with the same application code.

★ 33.1k⟳ yesterdayMIT