rapa icon indicating copy to clipboard operation
rapa copied to clipboard

Not available in a maven repo

Open tbee opened this issue 12 years ago • 10 comments

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.

tbee avatar Sep 22 '13 17:09 tbee

Thanks Tom. I will start work on uploading it to Maven Central.

harikrishnan83 avatar Sep 23 '13 01:09 harikrishnan83

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

harikrishnan83 avatar Sep 26 '13 18:09 harikrishnan83

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.

tbee avatar Sep 28 '13 07:09 tbee

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

harikrishnan83 avatar Sep 29 '13 14:09 harikrishnan83

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

tbee avatar Sep 30 '13 07:09 tbee

Thanks Tom. I will add support in rapa to set and get headers.

Regards, HariKrishnan

harikrishnan83 avatar Sep 30 '13 07:09 harikrishnan83

Hi Tom,

I have added the support for setting request headers. Below are the instructions.

  1. 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>
    
  2. 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

harikrishnan83 avatar Oct 02 '13 14:10 harikrishnan83

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

harikrishnan83 avatar Oct 10 '13 09:10 harikrishnan83

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.

tbee avatar Oct 10 '13 09:10 tbee

No worries. Please take your time.

harikrishnan83 avatar Oct 10 '13 09:10 harikrishnan83