(self)
| 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): |