Skip to content

Commit

Permalink
Add request object for delete as well
Browse files Browse the repository at this point in the history
  • Loading branch information
sansyrox committed Aug 3, 2021
1 parent 32f3905 commit 551d21a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,24 @@ 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")
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():
Expand Down

0 comments on commit 551d21a

Please sign in to comment.