简体   繁体   中英

Retrieve Text file content from Bitbucket

I want to Read the text file which is uploaded in BitBucket through REST Api.

URL: https://{username}:{token}/bitbucket.org/rest/api/1.0/{path}.

This gives JSON of folder content. I wanted to read text file and to extract the content. How to do it?

In term of API, make sure to not use the V1, which is deprecated for BitBucket .

One API endpoint which returns the content of a file would then be /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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM