I am using Content Negotiation to define multiple response for the same REST API function , by changing the accept header.
- Accept header : application/json , should give response as json (used by another service)
- Accept header : application/octet-stream , should download the same json response as a file with custom file extension , to be used by UI
Currently i am getting 406 when i pass application/octet-stream in the Accept header.
Is this the right approach ? or should i split the function in to 2 or is it better to use query parameters