MCPcopy
hub / github.com/encode/httpx / app

Function app

tests/conftest.py:59–76  ·  view source on GitHub ↗
(scope: Scope, receive: Receive, send: Send)

Source from the content-addressed store, hash-verified

57
58
59async def app(scope: Scope, receive: Receive, send: Send) -> None:
60 assert scope["type"] == "http"
61 if scope["path"].startswith("/slow_response"):
62 await slow_response(scope, receive, send)
63 elif scope["path"].startswith("/status"):
64 await status_code(scope, receive, send)
65 elif scope["path"].startswith("/echo_body"):
66 await echo_body(scope, receive, send)
67 elif scope["path"].startswith("/echo_binary"):
68 await echo_binary(scope, receive, send)
69 elif scope["path"].startswith("/echo_headers"):
70 await echo_headers(scope, receive, send)
71 elif scope["path"].startswith("/redirect_301"):
72 await redirect_301(scope, receive, send)
73 elif scope["path"].startswith("/json"):
74 await hello_world_json(scope, receive, send)
75 else:
76 await hello_world(scope, receive, send)
77
78
79async def hello_world(scope: Scope, receive: Receive, send: Send) -> None:

Callers

nothing calls this directly

Calls 8

slow_responseFunction · 0.85
status_codeFunction · 0.85
echo_binaryFunction · 0.85
redirect_301Function · 0.85
hello_world_jsonFunction · 0.85
echo_bodyFunction · 0.70
echo_headersFunction · 0.70
hello_worldFunction · 0.70

Tested by

no test coverage detected