MCPcopy
hub / github.com/encode/starlette / app_read_body

Function app_read_body

tests/test_formparsers.py:99–109  ·  view source on GitHub ↗
(scope: Scope, receive: Receive, send: Send)

Source from the content-addressed store, hash-verified

97
98
99async 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
112async def app_monitor_thread(scope: Scope, receive: Receive, send: Send) -> None:

Callers

nothing calls this directly

Calls 6

bodyMethod · 0.95
formMethod · 0.95
closeMethod · 0.95
RequestClass · 0.90
JSONResponseClass · 0.90
itemsMethod · 0.45

Tested by

no test coverage detected