From f880abf10df6ba324adbcee103646737be722b1c Mon Sep 17 00:00:00 2001 From: DingZQ Date: Sat, 15 Oct 2022 17:42:48 +0800 Subject: [PATCH] Batch --- main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 38814f4..05880ce 100644 --- a/main.py +++ b/main.py @@ -97,9 +97,12 @@ async def fastapi_sync_with_server(network: str, operationid: int) -> ChangeSet: return sync_with_server(network, operationid) @app.post("/batch/") -async def fastapi_execute_batch_commands(network: str, payload: dict = Body(...)) -> ChangeSet: - print(payload) - +async def fastapi_execute_batch_commands(network: str, req: Request)-> ChangeSet: + jsTxt = await req.json() + jo = json.loads(jsTxt) + print(jo) + print(type(jo)) + # node @app.get("/getnodes/") async def fastapi_get_nodes(network: str) -> list[str]: