使用REST API [英] Using REST APIs

查看:212
本文介绍了使用REST API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Gerrit的新手.我正在使用gerrit V. 2.6.我想在我的python脚本中使用gerrit REST API.但无法弄清楚如何使用它.我尝试了下面的代码,但出现错误.

I am new to gerrit. I am using gerrit V. 2.6 . I want to use gerrit REST APIs in my python script. But not able to figure out how to use it. I tried below code but getting errors.

curl --digest --user user:password http://server/a/changes/path/to/project~branch~change_id/rebase

获取错误:

需要401授权

此服务器无法验证您 被授权访问文档 要求.您提供的是错误的 凭据(例如,错误的密码),或您的 浏览器不知道如何提供 所需的凭据.

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

我错过了什么吗??

推荐答案

您是否使用了正确的username:password组合?这不是您的网络密码,而是gerrit生成的HTTP密码.您可以通过转到设置"->"HTTP密码"来找到它.如果密码框为空白,请单击按钮,让Gerrit生成新密码.

Are you using the correct username:password combination? This isn't your network password - it is the HTTP password that gerrit generates. You can find it by going to Settings->HTTP Password. If the password box is blank, click the button to have Gerrit generate a new password.

这篇关于使用REST API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆