Support constants from RFC9110 #3162
Unanswered
mbeijen
asked this question in
Potential Issue
Replies: 1 comment 2 replies
-
My PR for core python has been merged 🚀 but |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
httpx.codes
contains constants for HTTP status codes. However it does not support the names as defined in RFC9110.https://www.rfc-editor.org/rfc/rfc9110.html#name-changes-from-rfc-7231
This RFC for instance defines some status codes previously only used in WEBDAV and assigns more generic names to them, such as HTTP 422, which previously was
UNPROCESSABLE ENTITY
and now isUNPROCESSABLE CONTENT
. There are several more.I found out about this issue because one of the systems we interface with started returning HTTP 422 Unprocessable Content, and I wanted to catch this in code, and I could not find the constant for
UNPROCESSABLE_CONTENT
, only forUNPROCESSABLE_ENTITY
, which made me think that might be a different error, but it's just the 'old' name.So I think httpx should also support the status codes as described and named in RFC9110. The old constants should be kept for backwards compatibility.
'core' python also carries these status codes. They have the same issue, I've created python/cpython#117611 for that.
Beta Was this translation helpful? Give feedback.
All reactions