2017-08-19 74 views
0

我在api請求中收到401未經授權的錯誤。它適用於每個其他api端點(連接,服務器,類)而不是查詢端點。有誰知道是否需要額外的參數進行授權?OrientDB HTTP REST 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."}]}

回答

1

您可以使用 「query」 或 「class」,以獲取有關類的信息:

http://localhost:2480/query/DB/sql/Select from Results 

 

http://localhost:2480/class/DB/Results 

請記住,你只能做通過「查詢」命令獲取請求。

+0

Aww軟糖,我沒有看到額外的'/ class',謝謝指出! – Leon