But imagine that your server expects a HTTP request (of course an authenticated request), and he will be serving you the file as a octet-stream or as an Attachment in the response.
To understand the scenario properly, consider the following Web API action.
The action is expecting a URL parameter and based on the parameter it will be serving you either a pdf file or a zip file. Now to download a file by calling this endpoint, I believe what the most people would think is, following would work (including me).
So here is a workaround.
So this is the output.
I have uploaded the sample to my OneDrive, so you can download and play around.