@@ -549,7 +549,7 @@ def _build_url(self, path: str) -> str:
549549
550550 def _check_redirects (self , result : requests .Response ) -> None :
551551 # Check the requests history to detect 301/302 redirections.
552- # If the initial verb is POST or PUT, the redirected request will use a
552+ # If the initial method is POST or PUT, the redirected request will use a
553553 # GET request, leading to unwanted behaviour.
554554 # If we detect a redirection with a POST or a PUT request, we
555555 # raise an exception with a useful error message.
@@ -606,7 +606,8 @@ def _prepare_send_data(
606606
607607 def http_request (
608608 self ,
609- verb : str ,
609+ * ,
610+ method : str ,
610611 path : str ,
611612 query_data : Optional [Dict [str , Any ]] = None ,
612613 post_data : Optional [Union [Dict [str , Any ], bytes ]] = None ,
@@ -621,7 +622,7 @@ def http_request(
621622 """Make an HTTP request to the Gitlab server.
622623
623624 Args:
624- verb : The HTTP method to call ('get', 'post', 'put', 'delete')
625+ method : The HTTP method to call ('get', 'post', 'put', 'delete')
625626 path: Path or full URL to query ('/projects' or
626627 'http://whatever/v4/api/projecs')
627628 query_data: Data to send as query parameters
@@ -678,7 +679,7 @@ def http_request(
678679 cur_retries = 0
679680 while True :
680681 result = self .session .request (
681- method = verb ,
682+ method = method ,
682683 url = url ,
683684 json = json ,
684685 data = data ,
@@ -759,7 +760,7 @@ def http_get(
759760 """
760761 query_data = query_data or {}
761762 result = self .http_request (
762- "get" , path , query_data = query_data , streamed = streamed , ** kwargs
763+ method = "get" , path = path , query_data = query_data , streamed = streamed , ** kwargs
763764 )
764765
765766 if (
@@ -856,8 +857,8 @@ def http_post(
856857 post_data = post_data or {}
857858
858859 result = self .http_request (
859- "post" ,
860- path ,
860+ method = "post" ,
861+ path = path ,
861862 query_data = query_data ,
862863 post_data = post_data ,
863864 files = files ,
@@ -904,8 +905,8 @@ def http_put(
904905 post_data = post_data or {}
905906
906907 result = self .http_request (
907- "put" ,
908- path ,
908+ method = "put" ,
909+ path = path ,
909910 query_data = query_data ,
910911 post_data = post_data ,
911912 files = files ,
@@ -933,7 +934,7 @@ def http_delete(self, path: str, **kwargs: Any) -> requests.Response:
933934 Raises:
934935 GitlabHttpError: When the return code is not 2xx
935936 """
936- return self .http_request ("delete" , path , ** kwargs )
937+ return self .http_request (method = "delete" , path = path , ** kwargs )
937938
938939 @gitlab .exceptions .on_http_error (gitlab .exceptions .GitlabSearchError )
939940 def search (
@@ -987,7 +988,9 @@ def _query(
987988 self , url : str , query_data : Optional [Dict [str , Any ]] = None , ** kwargs : Any
988989 ) -> None :
989990 query_data = query_data or {}
990- result = self ._gl .http_request ("get" , url , query_data = query_data , ** kwargs )
991+ result = self ._gl .http_request (
992+ method = "get" , path = url , query_data = query_data , ** kwargs
993+ )
991994 try :
992995 links = result .links
993996 if links :
0 commit comments