MCPcopy Create free account
hub / github.com/NoEdgeAI/doc2x-doc / preupload

Function preupload

Python/requests/pdf.py:10–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8
9
10def preupload():
11 url = f"{base_url}/api/v2/parse/preupload"
12 headers = {"Authorization": f"Bearer {secret}"}
13 res = rq.post(url, headers=headers)
14 res.raise_for_status() # 检查HTTP请求是否成功
15 data = res.json()
16 if data.get("code") == "success":
17 return data["data"]
18 raise Exception(f"get preupload url failed: {data}")
19
20
21def put_file(path: str, url: str):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected