add update page method

This commit is contained in:
Sarah 2022-02-19 13:49:48 +00:00
parent b9e2b5bad9
commit be157a9246
1 changed files with 10 additions and 0 deletions

View File

@ -46,3 +46,13 @@ def get_attachment_contents(attachment_id, wiki_url, token_id, token_secret):
attachment_data_decoded = base64.b64decode(attachment_data_encoded)
return attachment_data_decoded
def update_page(page_id, markdown, wiki_url, token_id, token_secret):
headers = {}
headers.update(get_auth_header(token_id, token_secret))
data = {}
data['markdown'] = markdown
requests.put(wiki_url + "/api/pages/{}".format(page_id), data=data, headers=headers)