On this page
Overview
Apache HttpClient is a Java client library for HTTP communication. Classic and asynchronous APIs, connection management, authentication, cookies, caching, and related protocol features provide a configurable transport layer for applications using HTTP/1.1 and HTTP/2.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Choose classic or asynchronous client APIs
Synchronous code can use the classic CloseableHttpClient API, while applications with higher concurrency requirements can use asynchronous transports. Both approaches share the HttpComponents configuration model for client behavior.
Manage connections, authentication, cookies, and related client state
Beyond sending requests, HttpClient supports connection reuse, authentication, cookies, redirects, compression, caching, and other behavior required by long-running HTTP clients.
Best fit
Before adoption
Version 5.6.4 requires Java 8 or newer
HttpClient 5.6.4 targets Java 8 or newer and is published as org.apache.httpcomponents.client5:httpclient5:5.6.4. Verify the application's JDK and resolved dependency set.
Moving from 4.x to 5.x changes packages and configuration APIs
The 5.x line uses org.apache.hc.client5 packages and new Maven coordinates. Treat upgrades from 4.5.x as a migration that requires API and configuration review rather than a version-only substitution.
Official sources
- [1]Apache HttpClient README(2026-10-03)
- [2]Apache HttpClient Quick Start(2026-10-03)
- [3]Apache HttpClient Maven coordinates(2026-10-03)
- [4]Apache HttpClient 5.6.4 dependencies(2026-10-03)
- [5]Apache HttpComponents project news(2026-10-03)
- [6]Apache HttpClient Apache-2.0 license(2026-10-03)
Supplemental curator note
For simple HTTP calls, the JDK's built-in client may already be sufficient. HttpClient becomes easier to justify when an application needs coordinated control over connection pools, authentication, cookies, caching, asynchronous transport, and related protocol behavior.
Try it in 3 steps
- 1
Add HttpClient 5.6.4 as a dependency
Add the dependency to an existing Maven project's
pom.xml. Java 8 or newer is required.<dependency><groupId>org.apache.httpcomponents.client5</groupId><artifactId>httpclient5</artifactId><version>5.6.4</version></dependency> - 2
Create a client that performs a GET request
Follow the classic API pattern from the official Quick Start, close the client, and inspect the response status. Import the required
org.apache.hc.client5.http.*classes.try (CloseableHttpClient httpclient = HttpClients.createDefault()) { ClassicHttpRequest request = ClassicRequestBuilder.get("https://httpbin.org/get").build(); httpclient.execute(request, response -> { System.out.println(response.getCode()); return null; }); } - 3
Build and verify the application
Run the existing project's tests or equivalent execution path and verify connection, TLS, proxy, and other environment-specific settings.
mvn test
Growth
Growth trends · Last 30 days
1,535 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 16
- Open PRs
- 10
Development activity is still being collected.
Built with
Categories and tags
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- httpcomponents
- Stars
- 1,535
- Forks
- 991
- Watchers
- 100
- Open issues
- 0
- Contributors
- 112
- Owner type
- Organization
- Primary language
- Java
- License
- Apache-2.0
- Repository last updated
- Oct 2, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Karate8,974 Stars
2 shared tag(s) · 1 shared category(s) · Same language
combine API tests, mock servers, and performance tests in one Gherkin-style framework
Java - Apache Tomcat8,258 Stars
2 shared tag(s) · 1 shared category(s) · Same language
deploy Java web applications with Servlet, JSP, WebSocket, and Jakarta web specifications
Java - Flask74,816 Stars
2 shared tag(s) · 1 shared category(s)
build Python WSGI applications with routing, request handling, and Jinja templates
Python - OkHttp47,081 Stars
2 shared tag(s) · 1 shared category(s)
centralize HTTP, TLS, connection reuse, caching, and DNS for Android/JVM applications
Kotlin - HTTPie CLI38,503 Stars
2 shared tag(s) · 1 shared category(s)
compose API requests with syntax optimized for human-readable terminal work
Python - Cap7,924 Stars
2 shared tag(s) · 1 shared category(s)
self-host a privacy-focused CAPTCHA alternative built around proof-of-work and instrumentation challenges
JavaScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.