File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -234,3 +234,27 @@ user. For example:
234
234
.. code-block :: python
235
235
236
236
p = gl.projects.create({' name' : ' awesome_project' }, sudo = ' user1' )
237
+
238
+ Advanced HTTP configuration
239
+ ===========================
240
+
241
+ python-gitlab relies on ``requests `` ``Session `` objects to perform all the
242
+ HTTP requests to the Gitlab servers.
243
+
244
+ You can provide your own ``Session `` object with custom configuration when
245
+ you create a ``Gitlab `` object.
246
+
247
+ The following sample illustrates how to define a proxy configuration when using
248
+ python-gitlab:
249
+
250
+ .. code-block :: python
251
+
252
+ import gitlab
253
+ import requests
254
+
255
+ session = requests.Session()
256
+ session.proxies = {
257
+ ' https' : os.environ.get(' https_proxy' ),
258
+ ' http' : os.environ.get(' http_proxy' ),
259
+ }
260
+ gl = gitlab.gitlab(url, token, api_version = 4 , session = session)
You can’t perform that action at this time.
0 commit comments