Output Types
From n² wiki
Nearby: Guides and Tutorials
This page describes how Bigfoot supports multiple output types (representations) for its services.
Each service is defined to have 1 or more named output types which can be selected by specifying the appropriate media type in the client's accept header. Additionally, services with more than one output type will also support a query parameter called output. The value of this parameter is the lowercase name of the desired output type. Clients that specify the output parameter will always receive that output type regardless of the accept headers they send.
In the documentation for each service the list of output types is always given in preferred order.
Services determines the output type to be used in a response in the following order:
- Output parameter matches one of the service's output types
- Output parameter is supplied but does not match one of the service's output types - a 400 Bad Request response is given
- Media type in the accept header matches one of the service's output types, tested in preferred order
- */* in the accept header - the first output type in the output type list is used
- No accept header - the first output type in the output type list is used
- No other matches - a 406 Not Acceptable response is given
[edit] Standard Output Types
html - The HTML response consists of an XHTML document and can be obtained either by specifying mime types of text/html or application/xhtml+xml in the request's accept header or by supplying an "output" query parameter with a value of "html". The response is sent with a content type header equal to the one matched in the accept header or text/html if the output parameter was specified.
rdf - The RDF response consists of an RDF/XML document and can be obtained either by specifying a mime type of application/rdf+xml in the request's accept header or by supplying an "output" query parameter with a value of "rdf". The response is sent with a content type header of application/rdf+xml
xml - The XML response consists of an XML document and can be obtained either by specifying a mime type of application/xml in the request's accept header or by supplying an "output" query parameter with a value of "xml". The response is sent with a content type header of application/xml
rss - The RSS response consists of an RSS 1.0 document and can be obtained either by specifying a mime type of application/rss+xml in the request's accept header or by supplying an "output" query parameter with a value of "rss". The response is sent with a content type header of application/rss+xml
json - The JavaScript Object Notation (JSON) response consists of a JSON document and can be obtained either by specifying a mime type of application/json in the request's accept header or by supplying an "output" query parameter with a value of "json". The response is sent with a content type header of application/json.

