Skip to content

Commit b2887a9

Browse files
committed
payload
1 parent f7befa6 commit b2887a9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
258 Bytes
Binary file not shown.

API/main.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from fastapi import FastAPI
2+
from fastapi.params import Body
23
app = FastAPI()
34

45

@@ -8,4 +9,9 @@ def root():
89

910
@app.get("/post")
1011
def get_posts():
11-
return {"data": "this is your post"}
12+
return {"data": "this is your post"}
13+
14+
@app.post("/createpost")
15+
def create_post(payload: dict = Body(...)):
16+
print(payload)
17+
return {"message": "this is my first post"}

0 commit comments

Comments
 (0)