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

Function handler_that_reads_body

tests/test_exceptions.py:46–48  ·  tests/test_exceptions.py::handler_that_reads_body
(request: Request, exc: BadBodyException)

Source from the content-addressed store, hash-verified

44
45
46async def handler_that_reads_body(request: Request, exc: BadBodyException) -> JSONResponse:
47 body = await request.body()
48 return JSONResponse(status_code=422, content={class="st">"body": body.decode()})
49
50
51class HandledExcAfterResponse:

Callers

nothing calls this directly

Calls 3

JSONResponseClass · 0.90
bodyMethod · 0.80
decodeMethod · 0.80

Tested by

no test coverage detected