Thing is, the file is located at a remote server (not a Cuba application) that requires to provide an Authorization header in the request to retrieve the file.
In my scenario, I’m able to a number of REST calls but I have no intermediate storage or something to first retrieve the file and then upload it through REST into our own Cuba application.
So basically, I want to provide a link in the Location header for the REST call to upload a file: Swagger UI AND have control over the Authorization header when this REST call and the retrieval of the file is actually executed by the Cuba application.
I’ve tried to illustrate the problem in the scenario below:
I think you misunderstand the Location header. It a response, not request header. After you make the POST request that uploads the file to CUBA app, the Location header in the response will contain a URL where just uploaded file can be download from the CUBA application.
As a solution of your problem, you’ll have to create custom REST controller that accepts required parameters (URL to the file in external server, tokens, etc.) and then does its ork - downloads the file by passed URL, saves it to CUBA app, etc.