"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
Request headers:
If-Modified-Since: for cache
If-None-Match: for cache
Status:
200 – this is the page
304 – not modified; body should be empty
404 – page does not exist (never created or deleted)
Headers:
Last-modified: last modification date of the page
ETag: entity tag for the page
Location: actual location if redirected
Body: JSON
id: id of the page
revision_id: revision ID of the page
title_key: prefixed DB key of the page, like "Talk:Main_Page"
display_title: title for display, like "Talk:Main Page"
html_url: full API URL for retrieving the HTML for the page
----
GET /page/{title}/html
Returns the page HTML. Title is escaped for slashes
Payload: empty
Request headers:
If-Modified-Since: for cache
If-None-Match: for cache
Status:
200 – this is the page
304 – not modified; body should be empty
404 – page does not exist (never created or deleted)
Headers:
Last-modified: last modification date of the page
ETag: entity tag for the page
Location: actual location if redirected
Body: HTML
HTML for the page as with action=rendered. No skin or navigation.