我想通过 REST Api 读取在 BitBucket 中上传的文本文件。
网址:https://{用户名}:{token}/bitbucket.org/rest/api/1.0/{path}。
这给出了文件夹内容的 JSON。我想阅读文本文件并提取内容。怎么做?
最佳答案
在 API 方面,确保不使用 V1, which is deprecated for BitBucket .
一个返回文件内容的 API 端点将是 /2.0/repositories/{workspace}/{repo_slug}/src
If the path matches a file, then the raw contents of the file are returned (unless the format=meta query parameter was provided, in which case a json document containing the file's meta data is returned).
If the path matches a directory, then a paginated list of file and directory entries is returned (if the format=meta query parameter was provided, then the json document containing the directory's meta data is returned).
关于json - 从 Bitbucket 中检索文本文件内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62275406/