From 551d21ae2220718c2898ee618f2616b36c11ca11 Mon Sep 17 00:00:00 2001 From: Sanskar Jethi Date: Wed, 4 Aug 2021 01:01:45 +0530 Subject: [PATCH] Add request object for delete as well --- test.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/test.py b/test.py index 818b9beeb..a659aee4d 100644 --- a/test.py +++ b/test.py @@ -20,7 +20,7 @@ async def test(): return static_file(path) @app.post("/jsonify") -async def json(body): +async def json(request): return jsonify({"hello": "world"}) @app.post("/post") @@ -28,18 +28,16 @@ async def postreq(request): return bytearray(request["body"]).decode("utf-8") @app.put("/put") -async def putreq(body): - return bytearray(body).decode("utf-8") +async def putreq(request): + return bytearray(request["body"]).decode("utf-8") @app.delete("/delete") -async def deletereq(body): - return bytearray(body).decode("utf-8") - +async def deletereq(request): + return bytearray(request["body"]).decode("utf-8") @app.patch("/patch") -async def patchreq(body): - return bytearray(body).decode("utf-8") - +async def patchreq(request): + return bytearray(request["body"]).decode("utf-8") @app.get("/sleep") async def sleeper():