Read request body if present. Returns bytes object with full request content.
(self)
| 302 | |
| 303 | @asyncio.coroutine |
| 304 | def read(self): |
| 305 | """Read request body if present. |
| 306 | |
| 307 | Returns bytes object with full request content. |
| 308 | """ |
| 309 | if self._read_bytes is None: |
| 310 | body = bytearray() |
| 311 | while True: |
| 312 | chunk = yield from self._payload.readany() |
| 313 | body.extend(chunk) |
| 314 | if chunk is EOF_MARKER: |
| 315 | break |
| 316 | self._read_bytes = bytes(body) |
| 317 | return self._read_bytes |
| 318 | |
| 319 | @asyncio.coroutine |
| 320 | def text(self): |