MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / fetch_xml

Function fetch_xml

docs/website/scripts/generate_cn1libs.py:169–178  ·  view source on GitHub ↗
(url: str)

Source from the content-addressed store, hash-verified

167
168
169def fetch_xml(url: str) -> str:
170 req = Request(
171 url,
172 headers={
173 "User-Agent": "cn1-website-generator/1.0",
174 "Accept": "application/xml,text/xml,*/*",
175 },
176 )
177 with urlopen(req, timeout=20) as resp: # nosec B310 - fixed trusted URL
178 return resp.read().decode("utf-8", errors="replace")
179
180
181def write_data(libs: List[Dict[str, str]], status: str, error: str = "") -> None:

Callers 1

mainFunction · 0.85

Calls 3

RequestClass · 0.85
readMethod · 0.65
decodeMethod · 0.45

Tested by

no test coverage detected