0

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.

1
  • 1
    I 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. Commented Jan 22, 2022 at 16:23

1 Answer 1

1

It looks like they raise GitlabHttpError for anything that isn't 200.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.