MCPcopy
hub / github.com/mitmproxy/mitmproxy / request

Function request

release/deploy-microsoft-store.py:94–106  ·  view source on GitHub ↗
(method: str, path: str, body: str = "")

Source from the content-addressed store, hash-verified

92
93
94def request(method: str, path: str, body: str = "") -> bytes:
95 print(f"{method} {path}")
96 conn.request(method, path, body, headers=headers)
97 resp = conn.getresponse()
98 data = resp.read()
99 print(f"{resp.status} {resp.reason}")
100 # noinspection PyUnreachableCode
101 if False:
102 assert "CI" not in os.environ
103 # This contains sensitive data such as the fileUploadUrl, so don't print it in production.
104 print(data.decode(errors="ignore"))
105 assert 200 <= resp.status < 300
106 return data
107
108
109print("Getting app info...")

Callers 1

Calls 3

requestMethod · 0.45
readMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…