Lke :meth:`read`, but assumes that body part contains text data. :param str encoding: Custom text encoding. Overrides specified in charset param of `Content-Type` header :rtype: str
(self, *, encoding=None)
| 386 | |
| 387 | @asyncio.coroutine |
| 388 | def text(self, *, encoding=None): |
| 389 | """Lke :meth:`read`, but assumes that body part contains text data. |
| 390 | |
| 391 | :param str encoding: Custom text encoding. Overrides specified |
| 392 | in charset param of `Content-Type` header |
| 393 | |
| 394 | :rtype: str |
| 395 | """ |
| 396 | data = yield from self.read(decode=True) |
| 397 | encoding = encoding or self.get_charset(default='latin1') |
| 398 | return data.decode(encoding) |
| 399 | |
| 400 | @asyncio.coroutine |
| 401 | def json(self, *, encoding=None): |