Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes Web Services and the fly likes File Transfers using ReST Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "File Transfers using ReST" Watch "File Transfers using ReST" New topic

File Transfers using ReST

abhijitg ga

Joined: Mar 01, 2012
Posts: 9
Hi All,

Not sure whether I am posting in the right forum.

Can we do file transfers using REST APIs? e.g the application is running on node1 exposes some APIs. The client code can run on node2 and call the APIs to fetch a file from Node1.

I researched and found that REST actually is based on underlying http protocol. So I guess it should be possible.

Please comment. Any sample code would definitely help.

J Dirksen

Joined: Sep 04, 2012
Posts: 13
Yes you can. The basic idea behind rest is that resources are identified by an unique URI and a specific media-type / content-type. Based on this URI you can use the basic HTTP methods to modify or retrieve the resources. If you create a REST api you can create a resouce that provides a list of files with their associated media-type. Your client can then just use HTTP GET to retrieve the file.
subject: File Transfers using ReST