diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2019-01-14 07:16:43 +0100 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2019-01-14 07:30:03 +0100 |
commit | f404d394960683d68ccaf3c129f75a2582a2fb77 (patch) | |
tree | d1303b44b3291db3088c9ac978db7c8efc23d0ca /gitlab/__init__.py | |
parent | 89679ce5ee502e57dbe7cec2b78f4f70b85fd3a5 (diff) | |
download | gitlab-feat/count.tar.gz |
[WIP] feat(api): Implement a count() methodfeat/count
Diffstat (limited to 'gitlab/__init__.py')
-rw-r--r-- | gitlab/__init__.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py index c280974..d37fb11 100644 --- a/gitlab/__init__.py +++ b/gitlab/__init__.py @@ -548,6 +548,28 @@ class Gitlab(object): else: return result + def http_head(self, path, query_data={}, **kwargs): + """Make a HEAD request to the Gitlab server. + + Args: + path (str): Path or full URL to query ('/projects' or + 'http://whatever/v4/api/projecs') + query_data (dict): Data to send as query parameters + **kwargs: Extra options to send to the server (e.g. sudo, page, + per_page) + + Returns: + requests.structures.CaseInsensitiveDict: A requests.header object + + Raises: + GitlabHttpError: When the return code is not 2xx + """ + + url = self._build_url(path) + result = self.http_request('head', url, query_data=query_data, + **kwargs) + return result.headers + def http_list(self, path, query_data={}, as_list=None, **kwargs): """Make a GET request to the Gitlab server for list-oriented queries. |