main
py 21 lines 700 Bytes
Raw
1 import httpx
2 from loguru import logger
3
4 from app.integrations.modules.schema.cato import CollectCato
5
6
7 async def post_to_copilot_cato_module(data: CollectCato, license_key: str = None) -> None:
8 """
9 Send a POST request to the copilot-cato-module Docker container.
10
11 Args:
12 data (CollectCato): The data to send to the copilot-cato-module Docker container.
13 """
14 logger.info(f"Sending POST request to http://copilot-cato-module/collect with data: {data.model_dump()}")
15 async with httpx.AsyncClient() as client:
16 await client.post(
17 "http://copilot-cato-module/collect",
18 json=data.model_dump(),
19 timeout=120,
20 )
21 return None