summaryrefslogtreecommitdiff
path: root/docs/api-usage.rst
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-01-31 18:16:05 +0100
committerNejc Habjan <hab.nejc@gmail.com>2021-01-31 18:16:05 +0100
commita69a214ef7f460cef7a7f44351c4861503f9902e (patch)
tree259094684eb4ea50f0a161cf44d96fdbcd75aa92 /docs/api-usage.rst
parentc5a37e7e37a62372c250dfc8c0799e847eecbc30 (diff)
downloadgitlab-feat/override-user-agent.tar.gz
docs: add docs and examples for custom user agentfeat/override-user-agent
Diffstat (limited to 'docs/api-usage.rst')
-rw-r--r--docs/api-usage.rst3
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/api-usage.rst b/docs/api-usage.rst
index 764f294..2a40cfa 100644
--- a/docs/api-usage.rst
+++ b/docs/api-usage.rst
@@ -26,6 +26,9 @@ To connect to a GitLab server, create a ``gitlab.Gitlab`` object:
# anonymous gitlab instance, read-only for public resources
gl = gitlab.Gitlab('http://10.0.0.1')
+ # Define your own custom user agent for requests
+ gl = gitlab.Gitlab('http://10.0.0.1', user_agent='my-package/1.0.0')
+
# make an API request to create the gl.user object. This is mandatory if you
# use the username/password authentication.
gl.auth()