@@ -653,7 +653,7 @@ def http_request(
653
653
retry_transient_errors : Optional [bool ] = None ,
654
654
max_retries : int = 10 ,
655
655
** kwargs : Any ,
656
- ) -> requests . Response :
656
+ ) -> http_backends . DefaultResponse :
657
657
"""Make an HTTP request to the Gitlab server.
658
658
659
659
Args:
@@ -749,7 +749,7 @@ def http_request(
749
749
self ._check_redirects (result .response )
750
750
751
751
if 200 <= result .status_code < 300 :
752
- return result . response
752
+ return result
753
753
754
754
def should_retry () -> bool :
755
755
if result .status_code == 429 and obey_rate_limit :
@@ -827,9 +827,10 @@ def http_get(
827
827
GitlabParsingError: If the json data could not be parsed
828
828
"""
829
829
query_data = query_data or {}
830
- result = self .http_request (
830
+ response = self .http_request (
831
831
"get" , path , query_data = query_data , streamed = streamed , ** kwargs
832
832
)
833
+ result = response .response
833
834
834
835
if (
835
836
result .headers ["Content-Type" ] == "application/json"
@@ -1010,7 +1011,7 @@ def http_post(
1010
1011
query_data = query_data or {}
1011
1012
post_data = post_data or {}
1012
1013
1013
- result = self .http_request (
1014
+ response = self .http_request (
1014
1015
"post" ,
1015
1016
path ,
1016
1017
query_data = query_data ,
@@ -1019,6 +1020,8 @@ def http_post(
1019
1020
raw = raw ,
1020
1021
** kwargs ,
1021
1022
)
1023
+ result = response .response
1024
+
1022
1025
try :
1023
1026
if result .headers .get ("Content-Type" , None ) == "application/json" :
1024
1027
json_result = result .json ()
@@ -1095,7 +1098,8 @@ def http_delete(self, path: str, **kwargs: Any) -> requests.Response:
1095
1098
Raises:
1096
1099
GitlabHttpError: When the return code is not 2xx
1097
1100
"""
1098
- return self .http_request ("delete" , path , ** kwargs )
1101
+ response = self .http_request ("delete" , path , ** kwargs )
1102
+ return response .response
1099
1103
1100
1104
@gitlab .exceptions .on_http_error (gitlab .exceptions .GitlabSearchError )
1101
1105
def search (
@@ -1149,7 +1153,9 @@ def _query(
1149
1153
self , url : str , query_data : Optional [Dict [str , Any ]] = None , ** kwargs : Any
1150
1154
) -> None :
1151
1155
query_data = query_data or {}
1152
- result = self ._gl .http_request ("get" , url , query_data = query_data , ** kwargs )
1156
+ response = self ._gl .http_request ("get" , url , query_data = query_data , ** kwargs )
1157
+ result = response .response
1158
+
1153
1159
try :
1154
1160
next_url = result .links ["next" ]["url" ]
1155
1161
except KeyError :
0 commit comments