我的 api
请求收到 401 未经授权的错误。它适用于所有其他 api 端点(连接、服务器、类),但不适用于查询端点。有谁知道授权是否需要额外的参数?
fetch(
'http://localhost:2480/class/query/DB/sql/'+'Select from Results',
{
headers: { 'Authorization': 'Basic ' + base64.encode('admin'+":"+'admin')},
}
).then((res)=>{
console.log(res)
return res;
})
Error: {[{code: 401, reason: "Unauthorized", content: "401 Unauthorized."}]}
最佳答案
您可以使用“query ”或“class ”来获取有关类的信息:
http://localhost:2480/query/DB/sql/Select from Results
http://localhost:2480/class/DB/Results
请记住,您只能使用“query”命令发出 GET 请求。
关于javascript - OrientDB HTTP REST Api 查询未经授权,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45766859/