Marklogic Rest Api Instance install - 指令怎么会失败?
Marklogic Rest Api Instance install - how can the instructions fail?
我在本地安装了 Marklogic。
想要设置一个 Rest Api 实例,所以我按照 https://developer.marklogic.com/learn/rest/setup#create-a-rest-api-instance
中的说明进行操作
我复制并粘贴了 curl 指令,去掉了反斜杠的续行
curl -v -X POST --anyauth -u admin:admin --header "Content-Type:application/json" -d '{"rest-api": { "name": "TutorialServer", "port": "8011", "database": "TutorialDB", "modules-database": "Tutorial-Modules" } }' http://localhost:8002/v1/rest-apis
它运行了,但我得到的响应是 "Your bootstrap payload caused the server to throw an error. Underlying error message: XDMP-JSONDOC: xdmp:get-request-body() -- Document is not JSON"。
我看不到 json 错误,虽然不是专家。 运行 于 Windows 8.1。我正在将文本复制到 Word 文档中,然后复制到 dos 提示符中。
你可能有十几个非常漂亮的字形,它们看起来像,但不是你想的那样。
重新开始,不要使用 Word 或记事本或其他纯 ascii 文本编辑器作为剪贴板。
仔细检查编码是否是 7 位 ascii 而不是 8859-1,或者输入它。
仔细检查像 od -c.
这样的十六进制转储
现代出版工具更喜欢良好的排版而不是字符编码保真度。
我现在相信这是一个逃避问题。 Marklogic 页面上显示的内容可能在 Linux 环境中有效。
Windows 对我有用的是不使用单引号。这意味着外部字符串包装器的双引号而不是单引号,并转义字符串中的双引号。
-d "{\"rest-api\": { \"name\": \"TutorialServer\", \"port\": \"8011\", \"database\": \"TutorialDB\", \"modules-database\": \"Tutorial-Modules\" } }" \
非常感谢来自 ML 的 Stephen C 为我解决了这个问题。
我在本地安装了 Marklogic。
想要设置一个 Rest Api 实例,所以我按照 https://developer.marklogic.com/learn/rest/setup#create-a-rest-api-instance
中的说明进行操作我复制并粘贴了 curl 指令,去掉了反斜杠的续行
curl -v -X POST --anyauth -u admin:admin --header "Content-Type:application/json" -d '{"rest-api": { "name": "TutorialServer", "port": "8011", "database": "TutorialDB", "modules-database": "Tutorial-Modules" } }' http://localhost:8002/v1/rest-apis
它运行了,但我得到的响应是 "Your bootstrap payload caused the server to throw an error. Underlying error message: XDMP-JSONDOC: xdmp:get-request-body() -- Document is not JSON"。
我看不到 json 错误,虽然不是专家。 运行 于 Windows 8.1。我正在将文本复制到 Word 文档中,然后复制到 dos 提示符中。
你可能有十几个非常漂亮的字形,它们看起来像,但不是你想的那样。 重新开始,不要使用 Word 或记事本或其他纯 ascii 文本编辑器作为剪贴板。 仔细检查编码是否是 7 位 ascii 而不是 8859-1,或者输入它。 仔细检查像 od -c.
这样的十六进制转储现代出版工具更喜欢良好的排版而不是字符编码保真度。
我现在相信这是一个逃避问题。 Marklogic 页面上显示的内容可能在 Linux 环境中有效。
Windows 对我有用的是不使用单引号。这意味着外部字符串包装器的双引号而不是单引号,并转义字符串中的双引号。
-d "{\"rest-api\": { \"name\": \"TutorialServer\", \"port\": \"8011\", \"database\": \"TutorialDB\", \"modules-database\": \"Tutorial-Modules\" } }" \
非常感谢来自 ML 的 Stephen C 为我解决了这个问题。