Description
The API already supports content negotiation through the Accept HTTP header, but this capability is currently undocumented.
When one of the following media types is specified, the default response format (application/json) is overridden and the output is returned accordingly:
| Accept Header |
Output Format |
application/vnd.toon+text |
Toon |
text/markdown |
Markdown |
application/xml |
XML |
application/json |
JSON (default) |
Example
GET /api/resource
Accept: text/markdown
The response will be returned in Markdown format instead of JSON.
Proposed Action
- Document supported
Accept header values.
- Add examples to the API documentation.
- Clarify that
application/json remains the default response format when no supported Accept header is provided.
Description
The API already supports content negotiation through the
AcceptHTTP header, but this capability is currently undocumented.When one of the following media types is specified, the default response format (
application/json) is overridden and the output is returned accordingly:application/vnd.toon+texttext/markdownapplication/xmlapplication/jsonExample
The response will be returned in Markdown format instead of JSON.
Proposed Action
Acceptheader values.application/jsonremains the default response format when no supportedAcceptheader is provided.