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.
posted 3 years ago
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.