Hi does anyone know if there is a way to get http status codes with python-gitlab? Or is there a way to use requests with python-gitlab to get the status codes?
Like how in the requests library you you can do r.status_code
and that will return 200 or another code.
Asked
Active
Viewed 525 times
0

AllUser
- 13
- 1
- 3
-
1I suspect this might be an XY problem. Why do you want to know the status codes? When requests are unsuccessful, an error will be raised and the status code will be in the message. You can also catch that exception and read the `response_code` attribute on the error object. – sytech Jan 22 '22 at 16:23
1 Answers
1
It looks like they raise GitlabHttpError for anything that isn't 200.

MatthewMartin
- 32,326
- 33
- 105
- 164