【发布时间】:2017-12-04 10:01:04
【问题描述】:
我正在尝试使用 Firefox 的 REST 客户端在 http://xyz:8002/LATEST/rest-apis 上发送 POST 请求。我添加了两个标题 Content-Type: application/xml 和 Authorization:Basic 我使用下拉菜单选择用户界面。请求的正文是 -
<rest-api xmlns="http://marklogic.com/rest-api">
<name>Status Dashboard</name>
<database>r75-xyz-v11</database>
<port>8020</port>
</rest-api>
作为回应,我收到了 401 Unauthoried。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>401 Unauthorized</title>
<meta name="robots" content="noindex,nofollow"/>
</head>
<body>
<h1>401 Unauthorized</h1>
</body>
</html>
我拥有管理员权限,并且在选择基本身份验证后出现的 UI 框中提供了相同的凭据。
【问题讨论】:
-
在调试模式下使用像 Curl 这样的命令行工具。分享命令和结果。一旦它工作,然后在你的 REST 客户端中重新创建
-
curl 是我的第一个选项,但这是受限制的,我没有系统的管理员权限。
-
很高兴它被排序。如果你可以访问查询控制台,你也可以使用 HTTP 客户端来做这样的测试。