"As a Reader, I want to get a page online, so that I can read it with my browser or HTML widget and it will load fast."
Downloading a large document encoded in JSON, then loading the HTML from the JSON into a browser or native HTML widget, is much less efficient that letting the browser or widget download the HTML itself. So, if the user is "online", we want to have two endpoints: one for the JSON representation of the page without HTML, and one for HTML only.
Note: TWO endpoints follow.
GET /page/{title}/bare
Returns the page as JSON. Title is escaped for slashes
Payload: empty
Notable request headers: none
Status:
200 – this is the page
404 – page does not exist (never created or deleted)
Notable response headers: none
Body: JSON
- id: numeric id of the page
- key: prefixed DB key of the page, like "Talk:Main_Page"
- title: title for display, like "Talk:Main Page"
- latest: latest revision of the page, object with these properties
- id: revision ID
- timestamp: revision timestamp
- license: Object for the preferred license of the page, including these properties:
- spdx: SPDX code
- url: URL for the license
- title: title of the license
- other_licenses: array of objects with {spdx, url, title} for other licenses the page is available under
- content_model: content model for the main slot of the page
- html_url: URL for the HTML stream for the page
GET /page/{title}/html
Returns the page HTML. Title is escaped for slashes
Payload: empty
Notable request headers: none
Status:
200 – this is the page
400 - the content model for the page isn't compatible with HTML output
404 – page does not exist (never created or deleted)
Notable response headers: none
Body: HTML
Reversible HTML for the page as generated by Parsoid. No skin or navigation.