Skip to content
Myr

Clarify that Response.ok will *only* return True/False

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Alex Chan · committed by Alex Chan · parent c3f2553 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:requests/models.py+2 added-2 removed
684 unmodified lines
685 return self.iter_content(128)686687 @property688 def ok(self):689 """Returns True if :attr:`status_code` is less than 400.689 """Returns True if :attr:`status_code` is less than 400, False if not.690691 This attribute checks if the status code of the response is between692 400 and 600 to see if there was a client error or a server error. If693 the status code, is between 200 and 400, this will return True. This693 the status code is between 200 and 400, this will return True. This694 is **not** a check to see if the response code is ``200 OK``.695 """696 try:697 self.raise_for_status()
251 unmodified lines