MCPcopy
hub / github.com/aio-libs/aiohttp / read

Method read

aiohttp/client_reqrep.py:700–719  ·  view source on GitHub ↗

Read response payload.

(self, decode=False)

Source from the content-addressed store, hash-verified

698
699 @asyncio.coroutine
700 def read(self, decode=False):
701 """Read response payload."""
702 if self._content is None:
703 try:
704 self._content = yield from self.content.read()
705 except:
706 self.close()
707 raise
708 else:
709 yield from self.release()
710
711 data = self._content
712
713 if decode:
714 warnings.warn(
715 '.read(True) is deprecated. use .json() instead',
716 DeprecationWarning)
717 return (yield from self.json())
718
719 return data
720
721 def _get_encoding(self):
722 ctype = self.headers.get(hdrs.CONTENT_TYPE, '').lower()

Callers 4

textMethod · 0.95
jsonMethod · 0.95
write_bytesMethod · 0.45
startMethod · 0.45

Calls 3

closeMethod · 0.95
releaseMethod · 0.95
jsonMethod · 0.95

Tested by

no test coverage detected