Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
/ EasyHttp Public archive

EasyHttp is a library providing a java http client designed to interact in a faster, more secure and simpler way with the http client introduced by Java 11.

License

Notifications You must be signed in to change notification settings

Bad-Pop/EasyHttp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EasyHttp

GitHub GitHub Workflow Status (branch) Sonar Coverage Sonar Tests

What is EasyHttp ?

EasyHttp is a library providing a java http client designed to interact in a faster, more secure and simpler way with the http client introduced by Java 11. EasyHttp is fully interoperable with the java http client as it is completely based on it.

With EasyHttp, you can delegate some repetitive tasks such as JSON serialization and deserialization, exception handling, but also interaction with http responses thanks to an extended and more complete API.

Finally, EasyHttp relies on the Vavr library in order to provide its users with a much more concise and powerful programming style and more maintainable thanks to functional programming. And all this in Java 17 and of course fully tested.

How to use EasyHttp ? /!\ Not yet pushed into the maven central

Maven :

<dependency>
    <groupId>com.github.bad-pop</groupId>
    <artifactId>easy-http</artifactId>
    <version>x.x.x</version>
</dependency>

Gradle :

implementation 'com.github.bad-pop:easy-http:x.x.x'

Example of usage :

var client = EasyHttpClientProvider.newClient();

var body = new Foo("bar");
var request = HttpRequest.newBuilder()
    .POST(client.createBodyPublisher(body))
    .uri(URI.create("https://domain.com/api/resources"))
    .build();

var reponse = client.sendEasy(request, BodyHandlers.ofString());
var responseBody = response.get().readBody(Bar.class);

About

EasyHttp is a library providing a java http client designed to interact in a faster, more secure and simpler way with the http client introduced by Java 11.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages