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

Function echo_body

tests/test_wsgi.py:33–45  ·  view source on GitHub ↗
(
    environ: WSGIEnvironment, start_response: StartResponse
)

Source from the content-addressed store, hash-verified

31
32
33def echo_body(
34 environ: WSGIEnvironment, start_response: StartResponse
35) -> typing.Iterable[bytes]:
36 status = "200 OK"
37 output = environ["wsgi.input"].read()
38
39 response_headers = [
40 ("Content-type", "text/plain"),
41 ]
42
43 start_response(status, response_headers)
44
45 return [output]
46
47
48def echo_body_with_response_stream(

Callers 1

log_to_wsgi_log_bufferFunction · 0.70

Calls 1

readMethod · 0.45

Tested by

no test coverage detected