Lke :meth:`read`, but assumes that body parts contains JSON data. :param str encoding: Custom JSON encoding. Overrides specified in charset param of `Content-Type` header
(self, *, encoding=None)
| 399 | |
| 400 | @asyncio.coroutine |
| 401 | def json(self, *, encoding=None): |
| 402 | """Lke :meth:`read`, but assumes that body parts contains JSON data. |
| 403 | |
| 404 | :param str encoding: Custom JSON encoding. Overrides specified |
| 405 | in charset param of `Content-Type` header |
| 406 | """ |
| 407 | data = yield from self.read(decode=True) |
| 408 | if not data: |
| 409 | return None |
| 410 | encoding = encoding or self.get_charset(default='utf-8') |
| 411 | return json.loads(data.decode(encoding)) |
| 412 | |
| 413 | @asyncio.coroutine |
| 414 | def form(self, *, encoding=None): |