Registry / http-client / httpclient5

httpclient5

JSON →
library5.6.1javamavenunverified

Apache HttpClient 5 is a modern HTTP client library for Java, supporting HTTP/1.1 and HTTP/2 protocols.

<dependency> <groupId>org.apache.httpcomponents.client5</groupId> <artifactId>httpclient5</artifactId> <version>5.6.1</version> </dependency>
INSTALL
IMPORT
SIG · HTTPCLIENT5
H
httpclient5
http-clientjavav5.6.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HttpGet
org.apache.hc.client5.http.classic.methods.HttpGet

Performs an HTTP GET request to example.com and prints the response body.

import org.apache.hc.client5.http.classic.methods.HttpGet; import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; import org.apache.hc.client5.http.impl.classic.HttpClients; import org.apache.hc.core5.http.io.entity.EntityUtils; public class Example { public static void main(String[] args) throws Exception { try (CloseableHttpClient client = HttpClients.createDefault()) { HttpGet request = new HttpGet("http://example.com"); String response = client.execute(request, response -> EntityUtils.toString(response.getEntity())); System.out.println(response); } } }
Debug
Known issues
breakingHttpClient 5 has breaking API changes from HttpClient 4.x; package names changed from org.apache.http to org.apache.hc.
fix
Update imports to use org.apache.hc packages and adjust method signatures accordingly.
affects: >=5.0
Upgrade
Version history
5.6.1latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
20
Resources
httpclient5 — mvn dependency:get httpclient5 · libregistry