Windows 以下 Linux 代码的变体

Windows Variant of the following Linux code

以下代码在 Linux 上运行,但使用 windows bat 文件时会抛出错误:

curl -X PUT --anyauth -u admin:admin --header "Content-Type:application/json" -d {"range-element-index":[{"scalar-type":"string", "namespace-uri":"", "localname":"userName", "collation":"http://marklogic.com/collation/codepoint", "range-value-positions":true,"invalid-values":"reject"}]} http://localhost:8002/manage/v2/databases/db/properties

错误如下:

curl: (6) Could not resolve host: namespace-uri
curl: (6) Could not resolve host: localname
curl: (6) Could not resolve host: collation:http
curl: (3) [globbing] unmatched close brace/bracket in column 49
{"errorResponse":{"statusCode":"400", "status":"Bad Request", "messageCode":"XDMP-JSONCHAR", "message":"XDMP-JSONCHAR: xdmp:unquote(\"{range-element-index:[{scalar-type:string,\", (), \"format-json\") -- Unexpected character 's' in JSON at line 1 char 36"}}

事实上,问题很可能是需要引用其余有效载荷。

ML 指南中有多个地方显示了 windows 个版本的命令(例如 MLCP)。

作为您的挑战示例 - 以及看起来像是解决方案的示例,请参阅本页底部的对话 - 包括 windows 上的 cUrl 命令的 screen-shots:

https://developer.marklogic.com/learn/rest/setup