diff --git a/requests/models.py b/requests/models.py index bbf08c81..a6af6427 100644 --- a/requests/models.py +++ b/requests/models.py @@ -655,8 +655,12 @@ class Response(object): self._content_consumed = True - # simulate reading small chunks of the content - reused_chunks = iter_slices(self._content, chunk_size) + if self._content_consumed and isinstance(self._content, bool): + raise RuntimeError( + 'The content for this response was already consumed') + else: + # simulate reading small chunks of the content + reused_chunks = iter_slices(self._content, chunk_size) stream_chunks = generate()