-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathREADME
93 lines (65 loc) · 2.45 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
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")