获取仓库具体路径下的内容
GET/api/v5/repos/:owner/:repo/contents/:path
Request
Path Parameters
owner stringrequired
仓库所属空间地址(组织或个人的地址path)
repo stringrequired
仓库路径(path)
path stringrequired
文件的路径
Query Parameters
access_token string
用户授权码
ref string
分支、tag或commit。默认: 仓库的默认分支(main)
Responses
- 200
成功响应
Response Headers
- application/json
- Schema
- Example (auto)
- Example
Schema
typestring
encodingstring
sizeinteger
namestring
pathstring
contentstring
shastring
urlstring
html_urlstring
download_urlstring
_links object
selfstring
htmlstring
{
"type": "string",
"encoding": "string",
"size": 0,
"name": "string",
"path": "string",
"content": "string",
"sha": "string",
"url": "string",
"html_url": "string",
"download_url": "string",
"_links": {
"self": "string",
"html": "string"
}
}
{
"type": "file",
"encoding": "base64",
"size": 19,
"name": "Note2.md",
"path": "Note2.md",
"content": "JXU2RDRCJXU4QkQ1d2ViaG9vaw==",
"sha": "e5699fe1b360d6c799ee58b24fb5a670b1e14851",
"url": "https://gitcode.com/api/v5/repos/daming_1/zhu_di/contents/Note2.md",
"html_url": "https://gitcode.com/daming_1/zhu_di/blob/master/Note2.md",
"download_url": "https://gitcode.com/daming_1/zhu_di/raw/master/Note2.md",
"_links": {
"self": "https://gitcode.com/api/v5/repos/daming_1/zhu_di/contents/Note2.md",
"html": "https://gitcode.com/daming_1/zhu_di/blob/master/Note2.md"
}
}