无法使用 CKAN API 进行本地主机安装

问题描述 投票:0回答:1

我在笔记本电脑中安装了 CKAN,我可以通过浏览器使用本地主机地址访问它,但无法通过 API 访问。

是不是有什么配置我没做?

如果我对某个 CKAN 存储库进行 Google App Script API 调用,我会得到预期的响应。

function conectarComCKAN() {
  var response = UrlFetchApp.fetch('https://dados.ufrj.br/api/3/action/group_list');
  Logger.log(response.getContentText());  
}

回应:

11:11:13    Notificação Execução iniciada
11:11:13    Informação  {"help": "https://dados.ufrj.br/api/3/action/help_show?name=group_list", "success": true, "result": ["chs", "pr5", "pr6", "pr1", "pr4", "pr3", "pr7", "pr2", "siarq", "sibi"]}
11:11:14    Notificação Execução concluída

如果我对本地主机存储库进行相同的 API 调用,则会收到错误。

function conectarComCKAN() {
  var response = UrlFetchApp.fetch('https://localhost/api/3/action/group_list');
  Logger.log(response.getContentText());  
}

错误:

11:16:40    Notificação Execução iniciada
11:16:41    Erro    
Exception: DNS error: https://localhost/api/3/action/group_list
conectarComCKAN @ Código.gs:2
localhost ckan
1个回答
0
投票

使用 HTTP 方法,而不是 HTTPS。

如果您的 CKAN 实例在端口 5000 上运行,请使用“http://localhost:5000/...”。

© www.soinside.com 2019 - 2024. All rights reserved.