(request)
| 32 | |
| 33 | @asyncio.coroutine |
| 34 | def hello(request): |
| 35 | resp = StreamResponse() |
| 36 | name = request.match_info.get('name', 'Anonymous') |
| 37 | answer = ('Hello, ' + name).encode('utf8') |
| 38 | resp.content_length = len(answer) |
| 39 | yield from resp.prepare(request) |
| 40 | resp.write(answer) |
| 41 | yield from resp.write_eof() |
| 42 | return resp |
| 43 | |
| 44 | |
| 45 | @asyncio.coroutine |