MCPcopy
hub / github.com/vladmandic/sdnext / post

Function post

cli/api-preprocess.py:37–42  ·  view source on GitHub ↗
(endpoint: str, dct: dict | None = None)

Source from the content-addressed store, hash-verified

35
36
37def post(endpoint: str, dct: dict | None = None):
38 req = requests.post(f'{sd_url}{endpoint}', json = dct, timeout=300, verify=False, auth=auth())
39 if req.status_code != 200:
40 return { 'error': req.status_code, 'reason': req.reason, 'url': req.url }
41 else:
42 return req.json()
43
44
45def info(args): # pylint: disable=redefined-outer-name

Callers 1

infoFunction · 0.70

Calls 2

authFunction · 0.70
postMethod · 0.45

Tested by

no test coverage detected