Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Implementing a client which uploads a file through Rest

 
vaibhav mishra
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic