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

Function post

cli/sdapi.py:118–130  ·  view source on GitHub ↗
(endpoint: str, json: dict | None = None)

Source from the content-addressed store, hash-verified

116
117
118async def post(endpoint: str, json: dict | None = None):
119 global sess # pylint: disable=global-statement
120 # sess = sess if sess is not None else await session()
121 if sess and not sess.closed:
122 await sess.close()
123 sess = await session()
124 try:
125 async with sess.post(url=endpoint, json=json, verify_ssl=False) as req:
126 res = await result(req)
127 return res
128 except Exception as err:
129 log.error({ 'session': err })
130 return {}
131
132
133def postsync(endpoint: str, json: dict | None = None):

Callers 4

generateFunction · 0.90
upscaleFunction · 0.90
initFunction · 0.90
interruptFunction · 0.70

Calls 4

sessionFunction · 0.85
resultFunction · 0.85
closeMethod · 0.45
postMethod · 0.45

Tested by

no test coverage detected