'Create rest endpoint for Json and Octet stream for same response data

I have an application where I have a table with some data. The data of the table is obtained from a rest endpoint '/content' with type application/json. The application also has the possibility to download the table content as an excel file. For this endpoint

  • should I create a separate endpoint. for ex: 'content/download'
  • should I use the same endpoint '/content' with header with application/octet-stream

I am just confused with the best practice here. Should I create entirely new endpoint or can I use the same endpoint with a different header(keep in mind that the response data is the same, it's the format which is different)?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source