diff options
author | Nejc Habjan <nejc.habjan@siemens.com> | 2022-11-26 15:59:20 +0100 |
---|---|---|
committer | Nejc Habjan <nejc.habjan@siemens.com> | 2022-11-26 15:59:20 +0100 |
commit | 875140296fada3659d224e3a5819ba77a81e36fe (patch) | |
tree | 5ed1344e9b1f265eb673341689a84a39f1527aa7 /docs/gl_objects/projects.rst | |
parent | 0ecf3bbe28c92fd26a7d132bf7f5ae9481cbad30 (diff) | |
download | gitlab-feat/decode-to-string.tar.gz |
feat(files): allow decoding project files directly to stringfeat/decode-to-string
Diffstat (limited to 'docs/gl_objects/projects.rst')
-rw-r--r-- | docs/gl_objects/projects.rst | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/gl_objects/projects.rst b/docs/gl_objects/projects.rst index 7fc0ab9..5285c40 100644 --- a/docs/gl_objects/projects.rst +++ b/docs/gl_objects/projects.rst @@ -434,9 +434,12 @@ Get a file:: # get the base64 encoded content print(f.content) - # get the decoded content + # get the decoded content as bytes print(f.decode()) + # get the decoded content as a string + print(f.decode("utf-8")) + Get file details from headers, without fetching its entire content:: headers = project.files.head('README.rst', ref='main') |