MarkLogic 8:无法使用cURL将XML文档加载到MarkLogic数据库

时间:2018-09-23 11:13:00

标签: xml database marklogic marklogic-8

我正在尝试加载具有内容的简单XML文档(我将其命名为one.xml)

<one>
 <child>The noble Brutus has told Caesar was ambitious</child>
</one>

到MarkLogic DB。

我在one.xml的目录中运行curl工具(Windows cmd),然后键入以下命令行:

   curl --anyauth --user user:password -x put  -d@"./one.xml" ^
   -h "Content-type: application/xml" ^
   "http://localhost:8000/LATEST/documents?uri=/xml/one.xml"

因此,如果请求成功,该服务将返回状态201(已创建文档)。 但是什么也没发生。相反,我收到了“ curl --help” 命令的结果。

我遵循MarkLogic网站的说明。链接:https://docs.marklogic.com/8.0/guide/rest-dev/intro#id_97899

向下滚动至 MarkLogic REST API入门文章。我被困在将文档加载到数据库中

P / S:MarkLogic网站中的curl命令行使用Unix语法,因此我通过此链接https://docs.marklogic.com/8.0/guide/rest-dev/intro#id_75672

将其更改为Windows语法。

我认为这是一个问题。请帮助我

1 个答案:

答案 0 :(得分:2)

您输错了-X parameter的类型,它必须是大写的X。小写的x parameter用于其他内容。

HTH!