Designed to be simple
EasyHttp provide a complete, powerful and fully documented API
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.
EasyHttp provide a complete, powerful and fully documented API
This project was created with the developers who will use it in mind. It offers a complete and robust API. Under the hood you will find functional programming and fully tested code
Need to work with HTTP requests ? Don't waste your time hardcoding and managing them. EasyHttp has already done that for you.
<dependency>
<groupId>com.github.bad-pop</groupId>
<artifactId>easy-http</artifactId>
<version>x.x.x</version>
</dependency>
implementation 'com.github.bad-pop:easy-http:x.x.x'
You must instantiate a new EasyHttpClient object using the EasyHttpClientProvider class :
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);