DRAFT
This information is preliminary and not yet (or only partially) implemented. Do not rely on any information presented here until this notice is removed.
When you GET a resource from a TiddlyWeb server, you must tell the server what data format you would like to receive. There are two ways to do this:
- Specifying a format extension
- Setting an HTTP header
Select by format extension
To select type by format extension, make a request of the form:
GET API_ROOT/RESOURCE.format
Where
format is as defined below.
| format | MIME type requested | MIME type returned |
|---|
| txt | text/plain | text/plain |
| html | text/html | text/html |
| json | application/json | application/json |
| wiki | text/x-tiddlywiki | text/html |
Select by Accept header
Instead of adding the
.format extension, you can set the HTTP
Accept header to one of the MIME types from the above table. In this case, your request is simply:
GET API_ROOT/RESOURCE
Ambiguous Requests
If
both .format and an
Accept header are given, the
.format takes precedence, assuming it is valid.