Good example of API's use of Accept header

In the HTTP calls, the Accept header is used to indicate the format the response should be returned in. So indicating the application/json would indicate, that the result should return the JSON, while the application/xml would indicate, that the result should be returned in XML. There are also other ones.

DocuSign is using this in their invoices API endpoint. Without indicating any Accept header, the endpoint for one invoice returns the JSON representation of the invoice. But calling the same endpoint with the application/pdf Accept header, the endpoint returns the PDF file of the invoice, if available.

It is rare to see the use of Accept header like this in the wild, so I was happy to see it.

Link to API documentation.