(scope, receive, send)
| 24 | |
| 25 | |
| 26 | async def echo_raw_path(scope, receive, send): |
| 27 | status = 200 |
| 28 | output = json.dumps({"raw_path": scope["raw_path"].decode("ascii")}).encode("utf-8") |
| 29 | headers = [(b"content-type", "text/plain"), (b"content-length", str(len(output)))] |
| 30 | |
| 31 | await send({"type": "http.response.start", "status": status, "headers": headers}) |
| 32 | await send({"type": "http.response.body", "body": output}) |
| 33 | |
| 34 | |
| 35 | async def echo_body(scope, receive, send): |