Java HTTP Client

HTTP/HTTPS client which support sync and async requests

License

License

Copyright 2006 Sun Microsystems, Inc
GroupId

GroupId

io.github.etuzon
ArtifactId

ArtifactId

java.http
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

Java HTTP Client
HTTP/HTTPS client which support sync and async requests
Project URL

Project URL

https://github.com/etuzon/Java-HTTP-Client
Source Code Management

Source Code Management

https://github.com/etuzon/Java-HTTP-Client

Download java.http

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.etuzon/java.http/ -->
<dependency>
    <groupId>io.github.etuzon</groupId>
    <artifactId>java.http</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.etuzon/java.http/
implementation 'io.github.etuzon:java.http:1.0.2'
// https://jarcasting.com/artifacts/io.github.etuzon/java.http/
implementation ("io.github.etuzon:java.http:1.0.2")
'io.github.etuzon:java.http:jar:1.0.2'
<dependency org="io.github.etuzon" name="java.http" rev="1.0.2">
  <artifact name="java.http" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.etuzon', module='java.http', version='1.0.2')
)
libraryDependencies += "io.github.etuzon" % "java.http" % "1.0.2"
[io.github.etuzon/java.http "1.0.2"]

Dependencies

compile (2)

Group / Artifact Type Version
io.github.etuzon : java.projects.core jar 1.0.13
org.apache.httpcomponents.client5 : httpclient5 jar 5.0-beta4

test (2)

Group / Artifact Type Version
org.testng : testng jar 6.9.8
io.github.etuzon : java.tests.core jar 1.0.8

Project Modules

There are no modules declared in this project.

HTTP Client

HTTP/HTTPS client support synced and asynced requests.

Example of synced request:

HttpClient httpClient = initHttpClient(HTTP_ADDRESS);

HttpObject httpObject = null;

try { httpObject = httpClient.sendGet(); } catch (HttpException | InvalidHttpRequestException e) { throw new AutomationUnitTestException(e); }

Example of asynced request:

HttpClient httpClient = initHttpClient(HTTP_ADDRESS);

HttpAsyncClient asyncHttpClient = null;

try { asyncHttpClient = httpClient.sendAsyncGet("get"); } catch (HttpException | InvalidHttpRequestException e) { throw new AutomationUnitTestException(e); }

private HttpClient initHttpClient(String url) throws AutomationUnitTestException { try { return new HttpClient(url); } catch (Exception e) { throw new AutomationUnitTestException(e); } }

Versions

Version
1.0.2
1.0.1
1.0.0