繁体   English   中英

以下Linux代码的Windows变体

[英]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命令的屏幕截图:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM