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

Function echo_body

tests/middleware/test_wsgi.py:29–40  ·  view source on GitHub ↗
(
    environ: Environment,
    start_response: StartResponse,
)

Source from the content-addressed store, hash-verified

27
28
29def echo_body(
30 environ: Environment,
31 start_response: StartResponse,
32) -> WSGIResponse:
33 status = "200 OK"
34 output = environ["wsgi.input"].read()
35 headers = [
36 ("Content-Type", "text/plain; charset=utf-8"),
37 ("Content-Length", str(len(output))),
38 ]
39 start_response(status, headers)
40 return [output]
41
42
43def raise_exception(

Callers

nothing calls this directly

Calls 1

readMethod · 0.80

Tested by

no test coverage detected