MCPcopy
hub / github.com/aio-libs/aiohttp / hello

Function hello

examples/web_srv.py:34–42  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

32
33@asyncio.coroutine
34def 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

Callers

nothing calls this directly

Calls 6

prepareMethod · 0.95
writeMethod · 0.95
write_eofMethod · 0.95
StreamResponseClass · 0.90
encodeMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected