Skip to content
Myr

Correct docstring for Response.ok

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

authored by Ian Cordasco · committed by Ian Cordasco · parent e674aa1 · Browse files · 1 file+7 added−1 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+7 added−1 removed

  • other:+7 added−1 removed

1 file+7 added−1 removed

modified:requests/models.py+7 added-1 removed
670 unmodified lines
671 return self.iter_content(128)672673 @property674 def ok(self):675 """Returns true if :attr:`status_code` is 'OK'."""675 """Returns True if :attr:`status_code` is less than 400.676677 This attribute checks if the status code of the response is between678 400 and 600 to see if there was a client error or a server error. If679 the status code, is between 200 and 400, this will return True. This680 is **not** a check to see if the response code is ``200 OK``.681 """682 try:683 self.raise_for_status()684 except HTTPError:685 return False
244 unmodified lines