MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / tresp

Function tresp

mitmproxy/test/tutils.py:77–95  ·  view source on GitHub ↗

Returns: mitmproxy.net.http.Response

(**kwargs)

Source from the content-addressed store, hash-verified

75
76
77def tresp(**kwargs) -> http.Response:
78 """
79 Returns:
80 mitmproxy.net.http.Response
81 """
82 default = dict(
83 http_version=b"HTTP/1.1",
84 status_code=200,
85 reason=b"OK",
86 headers=http.Headers(
87 ((b"header-response", b"svalue"), (b"content-length", b"7"))
88 ),
89 content=b"message",
90 trailers=None,
91 timestamp_start=946681202,
92 timestamp_end=946681203,
93 )
94 default.update(kwargs)
95 return http.Response(**default) # type: ignore

Callers 15

test_get_content_typeMethod · 0.90
test_get_content_typeMethod · 0.90
test_initMethod · 0.90
test_reprMethod · 0.90
test_status_codeMethod · 0.90
test_reasonMethod · 0.90
test_get_cookies_noneMethod · 0.90

Calls 1

updateMethod · 0.45

Tested by 15

test_get_content_typeMethod · 0.72
test_get_content_typeMethod · 0.72
test_initMethod · 0.72
test_reprMethod · 0.72
test_status_codeMethod · 0.72
test_reasonMethod · 0.72
test_get_cookies_noneMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…