import requests
import json

# question 1
f = open("../week01-html/Carviewer.html")
html = f.read()
print(html)

# question 2
apiKey = '46ceed910c24ff7cce8240e89ec7b71912f6f40f2ec55fd217ce150ad6d4f1c4'
url = 'https://api.html2pdf.app/v1/generate'

data = {'html' : html, 'apiKey':apiKey}
response = requests.post(url, json=data)
print (response.status_code)

# question 3
newFile = open("lab06.02.01.htmlaspdf.pdf", "wb")
newFile.write(response.content)

# question 4 - tested works
