def edit_page(id, name, space, content):
data = {}<EOL>data["<STR_LIT:id>"] = str(id)<EOL>data["<STR_LIT:type>"] = "<STR_LIT>"<EOL>data["<STR_LIT:title>"] = name<EOL>data["<STR_LIT>"] = {"<STR_LIT:key>": space}<EOL>data["<STR_LIT:body>"] = {"<STR_LIT>": {"<STR_LIT:value>": content, "<STR_LIT>": "<STR_LIT>"}}<EOL>data["<STR_LIT:version>"] = {"<STR_LIT>": <NUM_LIT:1>}<EOL>response = _api.rest("<STR_LIT:/>" + str(id), "<STR_LIT>", _json.dumps(data))<EOL>new_version = int(_json.loads(response)["<STR_LIT:message>"].split()[-<NUM_LIT:1>]) + <NUM_LIT:1><EOL>data["<STR_LIT:version>"]["<STR_LIT>"] = new_version<EOL>return _api.rest("<STR_LIT:/>" + str(id), "<STR_LIT>", _json.dumps(data))<EOL>
Update a page in Confluence.
    Parameters:
    - id: ID of the page you wish to edit.
    - name: name you would like to give to the page (usually the same name).
    - space: space where the page lives.
    - content: XHTML content to be written to the page.
    Notes: it is required to try an initial update to find the page version.