rapa
rapa copied to clipboard
Not available in a maven repo
I really like the fluent API that Rapa uses, but a downloadable jar would be highly required (I don't think I can access file:///home/hari/jsg/code-repo/maven-repository ;-) but even better would be uploading it to Maven central.
Thanks Tom. I will start work on uploading it to Maven Central.
Hi Tom,
I have uploaded rapa on a Github maven repository and I have updated the instructions with maven repo url in the link below. https://github.com/harikrishnan83/rapa/wiki/Documentation
I will continue working on pushing the library to Maven Central.
Thanks, HariKrishnan
Thanks!
By now I've already started using raw connections via Apache HttpClient, because I need to add signature headers to the request. Does Rapa expose the request object so I can do that? Then I may migrate to Rapa (the fluent API still is very luring :-)
Tom
On 2013-09-26 20:37, HariKrishnan wrote:
Hi Tom,
I have uploaded rapa on a Github maven repository and I have updated the instructions with maven repo url in the link below. https://github.com/harikrishnan83/rapa/wiki/Documentation
I will continue working on pushing the library to Maven Central.
Thanks, HariKrishnan
— Reply to this email directly or view it on GitHub https://github.com/harikrishnan83/rapa/issues/3#issuecomment-25192099.
Hi Tom,
Sorry, Rapa currently does not expose the request object. If you can paste a sample of what you are trying achieve, I would be glad to see if we can make modifications to Rapa. Pull requests are welcome as well. :)
Thanks, HariKrishnan
This is code that I've written on top of Apache's HttpClient using the example code I got from BOL, basically I need to be able to set and get headers.
final HttpGet request = new HttpGet("https://plazaapi.bol.com/services/rest/orders/v1/open");
request.addHeader("Content-MD5", "MD5");
request.addHeader("Content-Type", "application/xml");
request.addHeader("X-BOL-Date", "Tue, 15 Aug 2013 08:12:31 GMT");
final String stringToSign = AuthUtils.createStringToSign(request);
final String signedString = AuthUtils.calculateRFC2104HMAC(stringToSign, PRIVATE_KEY);
request.addHeader("X-BOL-Authorization", PUBLIC_KEY + ":" + signedString);
request.addHeader("Accept", "application/xml");
I must mention that this code is not working yet, I'm still on it with BOL to get it going. So there may be more.
Tom
Thanks Tom. I will add support in rapa to set and get headers.
Regards, HariKrishnan
Hi Tom,
I have added the support for setting request headers. Below are the instructions.
-
Add rapa 0.9.2 to your dependencies
<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> -
Set request headers
RestClient restClient = new RestClientBuilder().withUrl("http://localhost:3000/customers") .withUserName("username") .withPassword("password") .withFormatHandler(new JSonHandler()) .build(); Map<String, String> headers = new HashMap<String, String>(); headers.put("Content-MD5", "MD5"); headers.put("Content-Type", "application/xml"); Resource user = restClient.getById(1, User.class, headers);
Hope this helps.
Thanks, HariKrishnan
Hi Tom,
Let me know if you need any changes on the headers change I have explained in my previous response.
Thanks and Regards, HariKrishnan
Yes, will do. Currently I'm not actively working on the project, but had to switch to more urgent matters.
On 2013-10-10 11:53, HariKrishnan wrote:
Hi Tom,
Let me know if you need any changes on the headers change I have explained in my previous response.
Thanks and Regards, HariKrishnan
— Reply to this email directly or view it on GitHub https://github.com/harikrishnan83/rapa/issues/3#issuecomment-26041094.
No worries. Please take your time.