【发布时间】:2018-12-07 19:07:51
【问题描述】:
我正在尝试在我的项目中使用 Gerrit,我需要使用 REST API 访问此 gerrit。
我查看了此页面上的用户指南:https://gerrit-review.googlesource.com/Documentation/rest-api.html,但我很沮丧,因为我找不到命令行的确切链接地址。
比如我想获取服务器的版本信息,根据这个链接:https://gerrit-review.googlesource.com/Documentation/rest-api-config.html,我用这个命令:
$ curl -4 -G --digest --user user:password https://gerrit.xxx.com/gerrit/a/server/config/version HTTP/1.0
Unauthorizedcurl: (7) Failed connect to HTTP:80; No route to host
$
如果我使用http而不是https,是这样的:
$ curl -4 -G --digest --user user:password http://gerrit.xxx.com/gerrit/a/server/config/version HTTP/1.0
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://gerrit.xxx.com/gerrit/a/server/config/version">here</a>.</p>
</body></html>
curl: (7) Failed connect to HTTP:80; No route to host
$
而 TTT/PPP 是一个可以从这个 url 访问的项目:
https://gerrit.xxx.com/gerrit/#/admin/projects/TTT/PPP
我快要疯了,有人能帮帮我吗?
【问题讨论】: