Skip to content

Commit

Permalink
chore: use kwargs for http_request docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nejch authored and JohnVillalovos committed Oct 16, 2022
1 parent b4d53f1 commit 124abab
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/api-levels.rst
Expand Up @@ -86,14 +86,19 @@ For example, if for whatever reason you want to fetch allowed methods for an end
>>> gl = gitlab.Gitlab(private_token=private_token)
>>>
>>> response = gl.http_request("OPTIONS", "/projects")
>>> response = gl.http_request(verb="OPTIONS", path="/projects")
>>> response.headers["Allow"]
'OPTIONS, GET, POST, HEAD'
Or get the total number of a user's events with a customized HEAD request:

.. code-block:: python
>>> response = gl.http_request("HEAD", "/events", query_params={"sudo": "some-user"}, timeout=10)
>>> response = gl.http_request(
verb="HEAD",
path="/events",
query_params={"sudo": "some-user"},
timeout=10
)
>>> response.headers["X-Total"]
'123'

0 comments on commit 124abab

Please sign in to comment.