Skip to content

harikrishnan83/rapa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ActiveResource  like RESTClient for java

Typical Usage:

All you need are the url, username, password, scheme and realm. You could choose to leave out properties like username, 
password, scheme and realm if not applicable

RestClient restClient = new RestClientBuilder().withUrl("http://localhost:8080/customers")
                                               .withUserName("username")
                                               .withPassword("password")
                                               .withBasicAuthentication()
                                               .withRealm("realm")
                                               .withFormatHandler(new JSonHandler())
                                               .build();

Create
------

Customer customer = new Customer();
customer.setName("Hari");
restClient.save(customer);

update: Thanks to Marlin Engel, the save now also sets the id on the resource. Keep watching this space for more updates.

Read
----

customer = (Customer) restClient.getById(1, Customer.class);

Update
------

customer.setName("rapa");
restClient.update(customer);

Delete
------

restClient.delete(customer);

Documentation
-------------

Take a look at the wiki pages for more information. We are making the api much more easy to use in the next release.
"Documentation":https://github.com/harikrishnan83/rapa/wiki/Documentation 

Gradle/Maven repository urls
----------------------------

pom.xml

  <repositories>
    <repository>
      <id>rapa</id>
      <url>https://github.com/harikrishnan83/maven-repository/raw/master/</url>
    </repository>
  </repositories>
  
  <dependencies>
    <dependency>
      <groupId>org.rest.rapa</groupId>
      <artifactId>rapa</artifactId>
      <version>0.9.1</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>

gradle

  repositories {
      mavenRepo urls: 'https://github.com/harikrishnan83/maven-repository/raw/master/'
  }

  dependencies {
      compile 'org.rest.rapa:rapa:0.9.1'
  }

Contributing
------------

Use it and let us know your comments. As always your comments are most welcome.

If you want to be a contributor on this project send a mail to rapa-programmers at gmail dot com.

Check out the code to get a sneak peak of the improvements. We welcome critical feedback.
Quality

We strive to write better code and time to time try to better ourselves with review and metrics.

LICENSE
-------
 
Rapa is licensed under the Apache License, Version 2.0 (the "License")

Releases

No releases published

Packages

No packages published