user94
user94

Reputation: 419

How to use webfiles in document conversion of watson

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 "[email protected]/readme.html;type=text/html" "https://gateway.watsonplatform.net/document-conversion/api/v1/convert_document?version=2015-12-15"

Upvotes: 0

Views: 55

Answers (2)

Matt F
Matt F

Reputation: 712

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"

Upvotes: 1

Anton Prevosti
Anton Prevosti

Reputation: 92

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 "[email protected]".

Upvotes: 1

Related Questions