bookstack/WikiUtils.py

15 lines
400 B
Python
Raw Normal View History

2022-02-18 21:22:00 +00:00
import requests
def get_auth_header(token_id, token_secret):
return {"Authorization": "Token {}:{}".format(token_id, token_secret)}
def get_page_export_html(page_id, wiki_url, token_id, token_secret):
headers = {}
headers.update(get_auth_header(token_id, token_secret))
r = requests.get(wiki_url + "/api/pages/{}/export/html".format(page_id), headers=headers)
2022-02-18 21:48:47 +00:00
return r.text