Update code in endpoints/yolo-post.post.py
This commit is contained in:
parent
446d7ac9ba
commit
3e7ae63ab5
@ -4,9 +4,10 @@ from core.database import fake_users_db
|
|||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
@router.post("/yolo-post")
|
@router.post("/yolo-post")
|
||||||
async def yolo_post_handler(sentence: str):
|
async def yolo_post_handler(sentence: str = Body(...)):
|
||||||
"""Echo a sentence backwards"""
|
"""Echo sentence backwards"""
|
||||||
reversed_sentence = sentence[::-1]
|
reversed_sentence = sentence[::-1]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"message": "Sentence reversed successfully",
|
"message": "Sentence reversed successfully",
|
||||||
"original_sentence": sentence,
|
"original_sentence": sentence,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user