| 97 | |
| 98 | |
| 99 | async def app_read_body(scope: Scope, receive: Receive, send: Send) -> None: |
| 100 | request = Request(scope, receive) |
| 101 | # Read bytes, to force request.stream() to return the already parsed body |
| 102 | await request.body() |
| 103 | data = await request.form() |
| 104 | output = {} |
| 105 | for key, value in data.items(): |
| 106 | output[key] = value |
| 107 | await request.close() |
| 108 | response = JSONResponse(output) |
| 109 | await response(scope, receive, send) |
| 110 | |
| 111 | |
| 112 | async def app_monitor_thread(scope: Scope, receive: Receive, send: Send) -> None: |