MCPcopy
hub / github.com/psf/requests / echo_response_handler

Function echo_response_handler

tests/test_lowlevel.py:12–21  ·  tests/test_lowlevel.py::echo_response_handler

Simple handler that will take request and echo it back to requester.

(sock)

Source from the content-addressed store, hash-verified

10
11
12def echo_response_handler(sock):
13 class="st">""class="st">"Simple handler that will take request and echo it back to requester."class="st">""
14 request_content = consume_socket_content(sock, timeout=0.5)
15
16 text_200 = (
17 bclass="st">"HTTP/1.1 200 OK\r\n"
18 bclass="st">"Content-Length: %d\r\n\r\n"
19 bclass="st">"%s"
20 ) % (len(request_content), request_content)
21 sock.send(text_200)
22
23
24def test_chunked_upload():

Callers

nothing calls this directly

Calls 2

consume_socket_contentFunction · 0.90
sendMethod · 0.45

Tested by

no test coverage detected