def read(self, amt=None, decode_content=None, cache_content=False):
<EOL>content_encoding = self.headers.get('<STR_LIT>', '<STR_LIT>').lower()<EOL>if self._decoder is None:<EOL><INDENT>if content_encoding in self.CONTENT_DECODERS:<EOL><INDENT>self._decoder = _get_decoder(content_encoding)<EOL><DEDENT><DEDENT>if decode_content is None:<EOL><INDENT>decode_content = self.decode_content<EOL><DEDENT>if self._fp is None:<EOL><INDENT>return<EOL><DEDENT>flush_decoder = False<EOL>try:<EOL><INDENT>try:<EOL><INDENT>if amt is None:<EOL><INDENT>data = self._fp.read()<EOL>flush_decoder = True<EOL><DEDENT>else:<EOL><INDENT>cache_content = False<EOL>data = self._fp.read(amt)<EOL>if amt != <NUM_LIT:0> and not data:  <EOL><INDENT>self._fp.close()<EOL>flush_decoder = True<EOL><DEDENT><DEDENT><DEDENT>except SocketTimeout:<EOL><INDENT>raise ReadTimeoutError(self._pool, None, '<STR_LIT>')<EOL><DEDENT>except BaseSSLError as e:<EOL><INDENT>if not '<STR_LIT>' in str(e):  <EOL><INDENT>raise<EOL><DEDENT>raise ReadTimeoutError(self._pool, None, '<STR_LIT>')<EOL><DEDENT>except HTTPException as e:<EOL><INDENT>raise ProtocolError('<STR_LIT>' % e, e)<EOL><DEDENT>self._fp_bytes_read += len(data)<EOL>try:<EOL><INDENT>if decode_content and self._decoder:<EOL><INDENT>data = self._decoder.decompress(data)<EOL><DEDENT><DEDENT>except (IOError, zlib.error) as e:<EOL><INDENT>raise DecodeError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" % content_encoding, e)<EOL><DEDENT>if flush_decoder and decode_content and self._decoder:<EOL><INDENT>buf = self._decoder.decompress(binary_type())<EOL>data += buf + self._decoder.flush()<EOL><DEDENT>if cache_content:<EOL><INDENT>self._body = data<EOL><DEDENT>return data<EOL><DEDENT>finally:<EOL><INDENT>if self._original_response and self._original_response.isclosed():<EOL><INDENT>self.release_conn()<EOL><DEDENT><DEDENT>
Similar to :meth:`httplib.HTTPResponse.read`, but with two additional
parameters: ``decode_content`` and ``cache_content``.

:param amt:
    How much of the content to read. If specified, caching is skipped
    because it doesn't make sense to cache partial content as the full
    response.

:param decode_content:
    If True, will attempt to decode the body based on the
    'content-encoding' header.

:param cache_content:
    If True, will save the returned data such that the same result is
    returned despite of the state of the underlying file object. This
    is useful if you want the ``.data`` property to continue working
    after having ``.read()`` the file object. (Overridden if ``amt`` is
    set.)