0

We recently implemented the Document Conversion API from IBM Watson.In this can I use web files (www.something.com) as input.

curl -X POST -u "username":"password" -F config="{\"conversion_target\":\"answer_units\"}" -F "file=@www.something.com/readme.html;type=text/html" "https://gateway.watsonplatform.net/document-conversion/api/v1/convert_document?version=2015-12-15"

user94
  • 409
  • 1
  • 6
  • 20

2 Answers2

1

No, you first need to download the HTML file that you want to convert. Then you can pass it to the Document Conversion Service as -F "file=@downloadedFile.html".

1

Alternatively, you could pipe STDIN into the curl command:

curl 'https://en.wikipedia.org/wiki/Terrestrial_Planet_Finder' | \
curl -u $USERPASS -F "config=@dcs_config.json" -F file=@- "$URL/v1/convert_document?version=2017-01-01"
Matt F
  • 682
  • 5
  • 7