Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File Transfers using ReST

 
abhijitg ga
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Author
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic