Downloading PDF Files by REST API is it good decision?
I try to find the best way to download doctype’s pdf file on my local machine. Can somebody recommend me? Try to google it, but without any result(
I have my part of code:
for item in items:
url = "http://" + frappe.request.host + "/api/method/frappe.utils.print_format.download_pdf?doctype=Certificate&name=" + \
item['name'] + \
"&format=New Horizons Certificate&no_letterhead=0"
doc = get_pdf(url)
with open('file.pdf','wb') as file:
When I opened my “file.pdf” as html page, I got error:
How I can download pdf file on my server? Is it correct way or what I make wrong?