Skip to content

buildin_endpoints_post_html

Marcel Kloubert edited this page Feb 11, 2017 · 3 revisions

Home >> Build-in endpoints >> [POST] /api/html

[POST] /api/html

Opens a new HTML document (tab) in editor.

canOpen property must be set to (true) for an user or guest in the settings to access the endpoint.

Example

Request:

POST /api/html

{
    "content": "<html>Hello, guys!</html>",
    "title": "An opened HTML document from REST API!"
}

Instead of submitting an object that uses the NewHtmlDocument interface, you can simply submit a JSON parsed string object, like "<html>Hello, guys!</html>".

Possible response:

Content-type: application/json; charset=utf-8
Content-encoding: gzip
X-Vscode-Restapi: 1.4.0
Date: Sat, 11 Feb 2017 21:15:53 GMT
Connection: keep-alive
Transfer-Encoding: chunked

{
    "code": 0
}

Other responses:

Code Description
403 User has no right to open HTML documents.
Clone this wiki locally