is a mechanism defined in the HTTP specification that makes it possible to serve different versions of a document (or more generally, a resource) at the same URI, so that user agents can specify which version fit their capabilities the best.
TiddlyWeb uses content negotiation to allow a user agent to declare which representation of a resource it prefers. Using the
Acceptheader the user agent can declare that it wants a
application/jsonversion of a resource (if available). With plugins other representations can be made available.
Content negotiation is a very significant contributor making any HTTP API powerful and flexible.
A user agent (often a person using a web browser) may also adjust the request URL to add an extension to simulate setting the
Acceptheader. For example to get the plain text representation of a bag resource one might request:
The default available extensions are:
- html to get
- txt to get
- json to get
- wiki to get
Not all resources provide all representations. See the HTTP API for details.
Supported extensions can be extended by creating and configuring another serialization in a plugin.