Tuesday, July 06, 2010

REST Client


This is a feature rich rest client what I developed and released to open source under EPL 1.0 for developers to play with web services. It can be used to test any URL for all HTTP methods
  • GET
  • POST
  • PUT
  • DELETE
  • HEAD 
  • OPTIONS
  • TRACE

Main Features

  1. Simultaneous views of request, response and browser.
  2. Post raw data or file, text content or binary.
  3. Post params in either body or as part of URL (twitter style).
  4. Post multipart form data with same ease as of normal post.
  5. Handle response equally well even if it is binary e.g. image, pdf etc. No gibberish characters anymore.
  6. Play with headers and params.

Min. Requirement

  • Java 1.6
  • Eclipse 3.4 (for plugin)
  • HTTP 1.1 compatibility

Project Home:

http://tinyurl.com/rest-client

Approved by eclipse.org:

http://marketplace.eclipse.org/content/rest-client


19 comments:

  1. Hi,

    This a really nice tool. I did have problems with https connection to a server with a self-signed cert. Reported in on the project. Let me know if you want help fixing it.

    /Håkan

    ReplyDelete
  2. Thanks Håkan. HTTPS issue what you reported has been fixed. Now All SSL validations are disabled by default. They can easily be customized if user wants to do so. Thanks again for helping in making developers' life easy.

    Ref: http://code.google.com/a/eclipselabs.org/p/restclient-tool/#SSL_Handling

    ReplyDelete
  3. I don't see a way to set the "Content-Type" header in POST requests. Am I missing something?

    ReplyDelete
  4. It determines content type automatically by reading stream in case of posting a file. It sends "text/plain" for anything on body pane.

    You may like to post any feature request, if it's not present, at project's page http://code.google.com/a/eclipselabs.org/p/restclient-tool/issues/list

    ReplyDelete
  5. This is cool tool. Could you tell me how to set authentication.

    ReplyDelete
  6. What kind of authentication you want to set? You may set authentication headers (if any) required by your service.

    ReplyDelete
  7. Thx Yadu. I am looking for Basic Authentication.

    ReplyDelete
  8. Currently it doesn't provide any way to create and add auth headers automatically. For basic HTTP authentication, you may have to add header manually after getting Base64 encoding of username:password like

    Authorization: Basic base64encode(myusername+":"+mypassword)

    =>

    Authorization: Basic bXl1c2VybmFtZTpteXBhc3N3b3Jk

    ReplyDelete
  9. Hi Yadu,

    I tried to add basic authentication manually (directly in under headers section) - it seems to be ignoed. Am I missing something?

    Thanks,
    Amir

    ReplyDelete
  10. Hi Yadu,

    the base64 result has = character at the end. It looks like it is being ignored, and I guess this is the reason why authentication fails (my first comment above)
    Is there a way to escape.overcome the issue?

    Thanks,
    Amir

    ReplyDelete
  11. Amir,

    I used these headers for testing, they work fine for me

    Content-Type=text/xml;charset=UTF-8
    Authorization=Basic dG9tOnBhc3Njb2Rl

    where dG9tOnBhc3Njb2Rl is Base64 of tom:passcode

    Do you have equals sign in your Base64 encoded string?

    ReplyDelete
  12. Amir,

    Yes you found the bug. I didn't read your last comment before posting mine.

    Can you create this issue @ http://code.google.com/a/eclipselabs.org/p/restclient-tool/issues/list ?

    I am working on existing issues. I'll include this one as well for next month release.

    ReplyDelete
  13. Thanks!
    is it scheduled to be released on the begining of the month?

    another question would be if I can use the rest API programatically and "inject" a URI dynamically.

    Thanks a lot,
    Amir

    ReplyDelete
  14. Next release is scheduled for later half of the next month.

    Yes you can use Java classes (Hitter.java), although it may need libs handling on user side.

    I like your idea. I'll try to make it available as ready-to-use Java REST client APIs in addition to existing standalone app and eclipse plugin.

    ReplyDelete
  15. Hi Yadu,

    I have installed RestClient Tool 1.0.3 in the Eclipse Version: 4.3.0 (Kepler) but I am getting "Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0)" Please can you let me know what has to be done for that. I didn't see any patches for this issue.

    Thank you.

    Brady

    ReplyDelete
  16. Hi Yadu,

    I have installed RestClient Tool 1.0.3 in the Eclipse Version: 4.3.0 (Kepler) but I am getting "Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0)" Please can you let me know what has to be done for that. I didn't see any patches for this issue.

    Thank you.

    Brady

    ReplyDelete
  17. This comment has been removed by the author.

    ReplyDelete
  18. I am using the exe version of rest-client on Windows Server 2012 R2 64-Bit with JRE 7 Update 51

    Tried to send some headers with the multipart request

    Authorization=Basic dGVzdDp0ZXN0MTIzNA==
    My-Head="Eyes and Nose = 123 "
    Foo=1234
    Bar="a text"
    Content-Type=multipart/related; boundary="NextPart_000_1-1113462319062"; type="text/xml"; start="mm7-submit"; charset="utf-8"

    but when it actually requests, it sends headers like this instead

    Authorization: Basic dGVzdDp0ZXN0MTIzNA
    Foo: 1234
    Bar: "a text"
    Content-Type: text/plain; charset=UTF-8

    Is this a bug or is there any compatibility issue with my environments?

    ReplyDelete
  19. Ittipan, This is a known bug should be fixed in next version.

    ReplyDelete