[英]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.