diff options
author | Max Wittig <max.wittig@siemens.com> | 2019-12-18 10:18:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-18 10:18:48 +0100 |
commit | 939e9d32e6e249e2a642d2bf3c1a34fde288c842 (patch) | |
tree | caef0d9e854728aab2e8571561d1df081548eb3a /docs/gl_objects | |
parent | ec6e04c16a8509519387b985a3ceef89d51a200b (diff) | |
download | gitlab-939e9d32e6e249e2a642d2bf3c1a34fde288c842.tar.gz |
docs(projects): add raw file download docs
Fixes #969
Diffstat (limited to 'docs/gl_objects')
-rw-r--r-- | docs/gl_objects/projects.rst | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/gl_objects/projects.rst b/docs/gl_objects/projects.rst index 3a40d8e..7ba80de 100644 --- a/docs/gl_objects/projects.rst +++ b/docs/gl_objects/projects.rst @@ -343,6 +343,13 @@ Get a file:: # get the decoded content print(f.decode()) + +Get a raw file:: + + raw_content = project.files.raw(file_path='README.rst', ref='master') + print(raw_content) + with open('/tmp/raw-download.txt', 'wb') as f: + project.files.raw(file_path='README.rst', ref='master', streamed=True, action=f.write) Create a new file:: |