[英]How do i get all directory and files in my github repository by using github api?
正如标题所说。 我想从 github api 获取所有文件和目录。
我发现了这个https://developer.github.com/v3/repos/contents/#get-contents 。
GET /repos/:owner/:repo/contents/:path
这个 api 表示Gets the contents of a file or directory in a repository. Specify the file path or directory in:path. If you omit:path, you will receive the contents of all files in the repository.
Gets the contents of a file or directory in a repository. Specify the file path or directory in:path. If you omit:path, you will receive the contents of all files in the repository.
我称之为 api 没有:path
它只是返回root
路径中的文件或目录。
响应数据有git_url
字段。 它有/repos/:owner/:repo/git/trees/:sha
api url。 这个 api 返回文件和目录。
1.
不可能,我是否必须递归调用 api (上述git_url
字段)来获取所有文件和目录?提前致谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.