EasyHttp

Work easily with http requests in java :)

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.

Designed to be simple

EasyHttp provide a complete, powerful and fully documented API

Designed to be robust

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

Designed to save you time

Need to work with HTTP requests ? Don't waste your time hardcoding and managing them. EasyHttp has already done that for you.

Get Started

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'
                        
                    

Create a new client

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);
                        
                    

Full Documentation

To see the full documentation, please check the github repository

More on GitHub

Do you like EasyHttp ?

I hope you find EasyHttp useful and. Feel free to get in touch if you have any questions or suggestions.

Bad_Pop
Backend Developer