'why am do i keep getting a 404 error code with postman when trying to receive the data? [closed]

for some reason i keep getting a 404 error code when trying to pull data from "Post" using postman

       from fastapi import FastAPI

       app = FastAPI()

       @app.get("/")
       def message_to_world():
       return {"message": "hey there gay man"}

       app.get("/posts")
       def get_posts():
       return {"data": "This is your posts"}

       @app.post("/createposts")
       def post_create():
       return{"message": "Nice job"}


Solution 1:[1]

Dont know if this is the answer as post is ambiguous from http post or your app.get /post. But app.get(/post) doesnt have the @ by it. Dont know the lang you're using that well but might just be a typo

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1