arachnys / athenapdf

Drop-in replacement for wkhtmltopdf built on Go, Electron and Docker
MIT License
2.26k stars 186 forks source link

[WEAVER] Can we pass an HTML as a string instead of a file in request body? #190

Closed fleboulch closed 5 years ago

fleboulch commented 5 years ago

I'm trying to pass a string (e.g.: "Hello World") instead of a file in the request body when using the microservice?

CURL request with a file (working fine)

curl -X POST \
  'http://localhost:8081/convert?auth=arachnys-weaver&ext=html' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F file=@/home/florent/tmp/athena.html

CURL request with string content (bad request)

curl -X POST \
  'http://localhost:8081/convert?auth=arachnys-weaver&ext=html' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F 'file=<html>Hello</html>'

My content-type header is maybe misconfigured

sanohin commented 5 years ago

seems like a duplicate of #180