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

Function echo_binary

tests/conftest.py:144–160  ·  view source on GitHub ↗
(scope: Scope, receive: Receive, send: Send)

Source from the content-addressed store, hash-verified

142
143
144async def echo_binary(scope: Scope, receive: Receive, send: Send) -> None:
145 body = b""
146 more_body = True
147
148 while more_body:
149 message = await receive()
150 body += message.get("body", b"")
151 more_body = message.get("more_body", False)
152
153 await send(
154 {
155 "type": "http.response.start",
156 "status": 200,
157 "headers": [[b"content-type", b"application/octet-stream"]],
158 }
159 )
160 await send({"type": "http.response.body", "body": body})
161
162
163async def echo_headers(scope: Scope, receive: Receive, send: Send) -> None:

Callers 1

appFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected