使用 curl 呈现和 return 来自 jsreport 的 pdf 文件

Using curl to render and return a pdf-file from jsreport

我正在尝试了解如何在 node.js 中使用 [jsreport][1]。

是否可以使用 curl 获取和保存 pdf 文件?

我在 jsreport 安装和网站上找不到任何文档。这对于 RESTful 库来说非常不寻常,我希望有几个 curl 示例。

好的,这似乎有效:

curl -H "Content-Type: application/json" -k -X  POST https://127.0.0.1/api/report -d"{\"template\": { \"shortid\" : \"NkerYDOXusdf\" }}" > report.pdf