How to get http status code in response? #107
-
|
Beta Was this translation helpful? Give feedback.
Answered by
earthboundkid
Feb 28, 2024
Replies: 1 comment
-
What's the exact need here? By default, |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
earthboundkid
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What's the exact need here? By default,
requests.Builder
will return an error if the status code is not a success code. The error can be examined withHasStatusErr
or usingerrors.As
to cast toResponseError
. If you need to allow only a certain set of codes (not any 2xxx), you can useCheckStatus
. If you want to record codes after the fact, there'sLogTransport
.