Closed mmaryo closed 5 years ago
In python you can do it with
html_str = "<html>...</html>"
resp = requests.post(
"http://localhost:8080/convert",
params={"auth": "arachnys-weaver"},
files={"file": ("input.html", html_str)},
)
For curl: curl -F "file=@path-to-file.html" http://localhost:8080/convert?auth=arachnys-weaver
Thanks And it would be great to be able to put html content as request body
You can already convert HTML via a POST request body. As for converting via a string from the URL parameter, I will have to veto this as most browsers do not support URLs with > 2000 characters, and I just don't think it's an appropriate way to transfer a "file" for conversion.
You can already convert HTML via a POST request body.
@MrSaints Could you point me to where I could find examples of generating a pdf from a POST request?
I can't figure out how to perform the request so that it works, it keeps saying "Invalid file provided"
Thanks in advance!
Hello
I would be great to convert an html String directely by using url
POST http://localhost:8080/convert?auth=arachnys-weaver Params: html=
HelloThanks