We are developing a Java REST based application and we have to convert reports in the following format (PDF, Excel, CSV, XML and HTML) and also there is a requirement to schedule reports at a predetermined intervals.
The data exchange format is JSON, what would be the best way for the user to download reports (for example PDF reports)
1) Do we need to send the PDF content as a JSON response
2) or do we need to send the title of the report and the URL link as the JSON response. In this case the URL link will represent the PDF file on the server side and by clicking the link, the user can download the report from the server
Or is there any alternate ways (best practices) for the user to download PDF reports in the modern browser (We assume only the latest version of major browsers will be used by our users ex. Firefox, Chrome, IE, Edge, Safari and Opera
Any pointers or links to some useful examples would be of immense help.