Request to RESTBase: `POST /{domain}/v1/transform/html/to/wt`. For an existing page, title and revision are passed: `POST /{domain}/v1/transform/html/to/wt/{title}/{revision}`
RESTBase retrieves the original html, wikitext & data-parsoid from storage & POSTs it to Parsoid:
```
POST parsoid/v2/{domain}/wt/{title}/{oldid}
{
"html": {
"headers": {
"content-type": "text/html;profile=mediawiki.org/specs/html/1.0.0"
},
"body": "<html>The modified HTML</html>"
},
"original": {
"revid": 12345,
"wikitext": {
"headers": {
"content-type": "text/plain;profile=mediawiki.org/specs/wikitext/1.0.0"
},
"body": "the original wikitext"
},
"html": {
"headers": {
"content-type": "text/html;profile=mediawiki.org/specs/html/1.0.0"
},
"body": "the original HTML"
},
"data-parsoid": {
"headers": {
"content-type": "application/json;profile=mediawiki.org/specs/data-parsoid/0.0.1"
},
"body": {
"ids": {}
}
}
}
}
```
If the modified `html` is just a string, then Parsoid is expected to assume that it's in the latest html version.
Parsoid returns the wikitext, which RESTBase returns to the client without any caching:
```
{
wikitext: {
headers: {
'content-type': 'text/plain;profile=mediawiki.org/specs/wikitext/1.0.0'
},
body: "the modified wikitext"
}
}
```
We could also just return the wikitext with the appropriate content-type header, but there is something to be said for consistency & the ability to return additional metadata (like warnings or errors) in the future.