Gitlab 和 JSON 格式
Gitlab and JSON format
我对 Gitlab 的 API 有疑问。我想将我项目的问题导出到 csv 文件。所以之前,我尝试使用 API 和这个命令:
curl -H "PRIVATE-TOKEN: mytoken" https://mygitlab/projects/4/issues
我的问题是输出是 html 模式,但我想要 json 格式。我不明白,因为在 api 中指定:
The API uses JSON to serialize data. You don't need to specify .json
at the end of an API URL.
有什么想法吗?
您尝试使用的 URL 不正确。
the format is:
https://yourgitlab/api/v3/projects/4/issues
所以,基本上您错过了 api/v3
部分并且您没有调用 api,而是请求 HTML 页面。
顺便说一下,当我查看 projects/4/issues
时,我认为 4 是来自 API 样本的值。确保改用您的项目 ID。
我对 Gitlab 的 API 有疑问。我想将我项目的问题导出到 csv 文件。所以之前,我尝试使用 API 和这个命令:
curl -H "PRIVATE-TOKEN: mytoken" https://mygitlab/projects/4/issues
我的问题是输出是 html 模式,但我想要 json 格式。我不明白,因为在 api 中指定:
The API uses JSON to serialize data. You don't need to specify .json at the end of an API URL.
有什么想法吗?
您尝试使用的 URL 不正确。
the format is:
https://yourgitlab/api/v3/projects/4/issues
所以,基本上您错过了 api/v3
部分并且您没有调用 api,而是请求 HTML 页面。
顺便说一下,当我查看 projects/4/issues
时,我认为 4 是来自 API 样本的值。确保改用您的项目 ID。