File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Implementing a client which uploads a file through Rest Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Implementing a client which uploads a file through Rest" Watch "Implementing a client which uploads a file through Rest" New topic
Author

Implementing a client which uploads a file through Rest

vaibhav mishra
Ranch Hand

Joined: Jun 18, 2008
Posts: 168
I want to implement a client in java which can upload a file through a Restful web service,I tried online examples but most of them reies on using JSP and servlet, and I am not able to comprehend how to do the same in the rest way, the only requirement I have is client is in java(not a web application, but a desktop application) , the rest service through server would be in any technology(as simple as possible) , can anybody recommend some pointers or tutorials to do the same


SCJP
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3268

RESTful calls can be made over HTTP, in fact the are in your case just straight HTTP calls (GET, POST, PUT, DELETE). So using something like HttpClient from Apache as a helper library will allow you to make calls to a server.

On the server side the service just has to respond to this HTTP request. I've found a nice way to do this is using Spring's 3.0 M3 RESTful support (which basically uses annotations to make dealing with REST requests really trivial).

Hope that helps a little!


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Implementing a client which uploads a file through Rest
 
Similar Threads
Get an OpenID token from a REST call
Web Service cleint error:urgent
web service not available
Help needed on restful web services
RestFul web services with Axis 2