MCPcopy
hub / github.com/mitmproxy/mitmproxy / treq

Function treq

mitmproxy/test/tutils.py:54–74  ·  view source on GitHub ↗

Returns: mitmproxy.net.http.Request

(**kwargs)

Source from the content-addressed store, hash-verified

52
53
54def treq(**kwargs) -> http.Request:
55 """
56 Returns:
57 mitmproxy.net.http.Request
58 """
59 default = dict(
60 host="address",
61 port=22,
62 method=b"GET",
63 scheme=b"http",
64 authority=b"",
65 path=b"/path",
66 http_version=b"HTTP/1.1",
67 headers=http.Headers(((b"header", b"qvalue"), (b"content-length", b"7"))),
68 content=b"content",
69 trailers=None,
70 timestamp_start=946681200,
71 timestamp_end=946681201,
72 )
73 default.update(kwargs)
74 return http.Request(**default) # type: ignore
75
76
77def tresp(**kwargs) -> http.Response:

Callers 15

test_get_urlMethod · 0.90
test_initMethod · 0.90
test_reprMethod · 0.90
test_methodMethod · 0.90
test_schemeMethod · 0.90
test_portMethod · 0.90
test_pathMethod · 0.90
test_authorityMethod · 0.90
test_get_host_headerMethod · 0.90

Calls 1

updateMethod · 0.45

Tested by 15

test_get_urlMethod · 0.72
test_initMethod · 0.72
test_reprMethod · 0.72
test_methodMethod · 0.72
test_schemeMethod · 0.72
test_portMethod · 0.72
test_pathMethod · 0.72
test_authorityMethod · 0.72
test_get_host_headerMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…