MCPcopy Create free account
hub / github.com/actix/examples / fetch

Function fetch

protobuf/client.py:47–57  ·  view source on GitHub ↗
(session)

Source from the content-addressed store, hash-verified

45
46
47async def fetch(session):
48 obj = test_pb2.MyObj()
49 obj.number = 9
50 obj.name = 'USB'
51 async with session.post('http://127.0.0.1:8080/', data=obj.SerializeToString(),
52 headers={"content-type": "application/protobuf"}) as resp:
53 print(resp.status)
54 data = await resp.read()
55 receiveObj = test_pb2.MyObj()
56 receiveObj.ParseFromString(data)
57 print(receiveObj)
58
59async def go(loop):
60 obj = test_pb2.MyObj()

Callers 3

postFunction · 0.85
goFunction · 0.85
gen_tls_certFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected