def __init__(self):
- self._content = None
+ self._content = False
self._content_consumed = False
#: Integer Code of responded HTTP Status.
def content(self):
"""Content of the response, in bytes."""
- if self._content is None:
+ if self._content is False:
# Read the contents.
try:
if self._content_consumed:
except AttributeError:
self._content = None
- self._content_consumed = True
+ self._content_consumed = True
return self._content
def _detected_encoding(self):
r = requests.get(httpbin('status', '404'))
r.text
+ def test_no_conent(self):
+ r = requests.get(httpbin('status', "0"), config={"safe_mode":True})
+ r.content
+ r.content
+
if __name__ == '__main__':
unittest.main()