Return BODY as text using encoding from .charset.
(self)
| 318 | |
| 319 | @asyncio.coroutine |
| 320 | def text(self): |
| 321 | """Return BODY as text using encoding from .charset.""" |
| 322 | bytes_body = yield from self.read() |
| 323 | encoding = self.charset or 'utf-8' |
| 324 | return bytes_body.decode(encoding) |
| 325 | |
| 326 | @asyncio.coroutine |
| 327 | def json(self, *, loads=json.loads, loader=None): |