Skip to main content
 首页 » 编程设计

python之如何解码 gerrit code review rest api 响应

2024年12月31日7jackei

我读过这篇文章是为了查询 gerrit https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html

但即使在文档中的示例中,gerrit 的响应在看起来像是更改详细信息记录的有效数组的开头也有这个乱码,这意味着它不是有效的 json。 我正在使用 python 的请求模块来访问/changes 端点。 有没有人成功解码从 gerrit 代码审查服务器输出的“json”?

请您参考如下方法:

您需要去除 Gerrit 输出的“)]}”前缀。

在 Gerrit 文档中查看更多详细信息 here .