MCPcopy Create free account
hub / github.com/encode/starlette / handler_that_reads_body

Function handler_that_reads_body

tests/test_exceptions.py:50–52  ·  view source on GitHub ↗
(request: Request, exc: BadBodyException)

Source from the content-addressed store, hash-verified

48
49
50async def handler_that_reads_body(request: Request, exc: BadBodyException) -> JSONResponse:
51 body = await request.body()
52 return JSONResponse(status_code=422, content={"body": body.decode()})
53
54
55class HandledExcAfterResponse:

Callers

nothing calls this directly

Calls 3

JSONResponseClass · 0.90
bodyMethod · 0.80
decodeMethod · 0.80

Tested by

no test coverage detected