(scope: Scope, receive: Receive, send: Send, name: str)
| 1160 | |
| 1161 | |
| 1162 | async def pure_asgi_echo_paths(scope: Scope, receive: Receive, send: Send, name: str) -> None: |
| 1163 | data = {"name": name, "path": scope["path"], "root_path": scope["root_path"]} |
| 1164 | content = json.dumps(data).encode("utf-8") |
| 1165 | await send( |
| 1166 | { |
| 1167 | "type": "http.response.start", |
| 1168 | "status": 200, |
| 1169 | "headers": [(b"content-type", b"application/json")], |
| 1170 | } |
| 1171 | ) |
| 1172 | await send({"type": "http.response.body", "body": content}) |
| 1173 | |
| 1174 | |
| 1175 | echo_paths_routes = [ |