尝试上传REST分机。到ML8。错误消息是“不允许使用方法”,此错误来自cURL。这是405错误。
这个错误对我来说还不够清楚。不知道在哪里寻找解决方案。这应该很简单,并且大多数代码是从ML网站或我的模板中复制/粘贴的。
卷曲
curl --anyauth --user 'thijs':'password' -X PUT -i -H "Content-type: application/vnd.marklogic-javascript" -d@"./plantinfo-ext.sjs" $URL'http://uien:8017/v1/config/resources/plantinfo?method=get'
cURL响应
HTTP/1.1 401 Unauthorized
Server: MarkLogic
WWW-Authenticate: Digest realm="public", qop="auth", nonce="fb8b383b56b4dba52dc", opaque="20e91abaf1b"
Content-Type: text/html; charset=utf-8
Content-Length: 209
Connection: Keep-Alive
Keep-Alive: timeout=5
HTTP/1.1 405 Method Not Allowed
Content-Type: text/html; charset=utf-8
Server: MarkLogic
Allow: DELETE, GET, HEAD, OPTIONS
Content-Length: 221
Connection: Keep-Alive
Keep-Alive: timeout=5
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>405 Method Not Allowed</title>
<meta name="robots" content="noindex,nofollow"/>
</head>
<body>
<h1>405 Method Not Allowed</h1>
</body>
</html>
REST分机。
/**
* @name plantinfo
* This REST extentsion provides SOAP service for the shipment data
*/
function get() {
doc = {'test': 'yes'};
return doc;
}
// Main
exports.GET = get;
ML错误
10.8.0.6 - thijs [09/Dec/2015:14:58:23 -0500] "PUT /v1/config/resources/plantinfo?method=get HTTP/1.1" 405 221 - "curl/7.35.0"
我只是使用了示例javascript文件,并使用以下命令将其加载:
curl --anyauth --user admin:admin -X PUT -i \
-H "Content-type: application/vnd.marklogic-javascript"\
--data-binary @"./test.sjs" \
'http://localhost:8000/v1/config/resources/example'
该示例来自文档,并且即使在ML 8.0中也可以正常工作。为此,我得到一个204:
我建议您在此处使用示例curl命令,如果它可以工作,请对其进行重构。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句