How to get http status code in response? #107
|
Answered by
earthboundkid
Feb 28, 2024
Replies: 1 comment
|
What's the exact need here? By default, |
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.Builderwill return an error if the status code is not a success code. The error can be examined withHasStatusError usingerrors.Asto 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.