【问题标题】:How to use webfiles in document conversion of watson如何在 watson 的文档转换中使用 webfiles
【发布时间】:2017-02-28 09:19:44
【问题描述】:

我们最近实现了 IBM Watson 的文档转换 API。在这个 API 中,我可以使用 Web 文件 (www.something.com) 作为输入。

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"

【问题讨论】:

    标签: curl watson document-conversion


    【解决方案1】:

    不,您首先需要下载要转换的 HTML 文件。然后您可以将其作为-F "file=@downloadedFile.html" 传递给文档转换服务。

    【讨论】:

      【解决方案2】:

      或者,您可以通过管道将 STDIN 输入 curl 命令:

      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"
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2023-04-02
        • 2016-09-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多