MCPcopy Create free account
hub / github.com/TEN-framework/ten-framework / get

Function get

tests/utils/http.py:69–82  ·  view source on GitHub ↗
(uri: str)

Source from the content-addressed store, hash-verified

67
68
69def get(uri: str):
70 try:
71 # Ignore the proxy settings in the environment.
72 proxy_handler = request.ProxyHandler({})
73 https_handler = request.HTTPSHandler(context=ctx)
74 opener = request.build_opener(proxy_handler, https_handler)
75
76 with opener.open(uri) as stream:
77 data = stream.read()
78 return data.decode("utf8")
79 except error.HTTPError as e:
80 return e.code
81 except Exception as e:
82 return str(e)
83
84
85def detect_port(ip: str, port: int) -> bool:

Callers 1

flow.tsxFile · 0.85

Calls 2

readMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected