CRest, HTTP Invoker with simple annotation


CRest (Client Representational State Transfer or Client REST) is a lightweight JAX-RS compatible framework aiming to simplify the integration of external REST services into java applications.

By using CRest, there is no need for a developer to spent a lot of efforts on the development. You can use annotation to easily create HTTP invoker against the server by specifying URL, parameters, and so on. Here is a quick example of what a CRest annotated interface would look like:

And here how you would get an instance of it:

And here is the output:

CRest instances are thread-safe, and should be created only once and reused when building REST interface proxies.

The builder allows you to easily customize the resulting CRest instance, please refer to its java-doc to see all the possible options available.

Current implementation requires all user provided interface method’s parameter to be annotated with any of the following:

  • @FormParam
  • @PathParam
  • @MatrixParam
  • @QueryParam
  • @HeaderParam
  • @CookieParam
  • @MultiPartParam

Once you have a CRest instance, you can pass it any java Interface that should be bind to any REST service.

To get more information about CRest, please click here.

  1. JS_KUN

    This is so great… easy and robust development !!!

    1. Robertus Lilik Haryanto

      Hi JS_KUN,

      Are you going to use this library also? Let me know if any issue on using it, hope I can help you then.

Leave a Reply

Your email address will not be published. Required fields are marked *