以下Linux代码的Windows变体

以下Linux代码的Windows变体,linux,marklogic,Linux,Marklogic,以下代码在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/colla

以下代码在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"}}

事实上,问题很可能是需要引用rest有效负载这一事实

在ML指南中有许多地方显示windows版本的命令(如MLCP)

作为您的挑战示例—以及解决方案,请参阅本页底部的对话—包括windows上cUrl命令的屏幕截图:


事实上,问题很可能是需要引用rest有效负载

在ML指南中有许多地方显示windows版本的命令(如MLCP)

作为您的挑战示例—以及解决方案,请参阅本页底部的对话—包括windows上cUrl命令的屏幕截图:


无法访问Windows box进行尝试,但您需要转义某些内容,可能是方括号或方括号。您是否考虑过将有效负载放入文件中?尝试一下它有一个非常好的bash shell无法访问Windows box进行尝试,但您需要转义某些内容,可能是方括号或花括号。您考虑过将有效负载放入文件中吗?尝试一下,它有一个非常好的bash shell