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

Method _get_encoding

aiohttp/client_reqrep.py:721–731  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

719 return data
720
721 def _get_encoding(self):
722 ctype = self.headers.get(hdrs.CONTENT_TYPE, '').lower()
723 mtype, stype, _, params = helpers.parse_mimetype(ctype)
724
725 encoding = params.get('charset')
726 if not encoding:
727 encoding = chardet.detect(self._content)['encoding']
728 if not encoding:
729 encoding = 'utf-8'
730
731 return encoding
732
733 @asyncio.coroutine
734 def text(self, encoding=None):

Callers 3

textMethod · 0.95
jsonMethod · 0.95

Calls 1

getMethod · 0.45

Tested by 1