I am trying to run the following code but I am getting a {"detail":"Method Not Allowed"} error when I open http://localhost:8000/predict.
The code:
from fastapi import FastAPI
app = FastAPI()
@app.post("/predict")
def predict_(request: str):
return {"message": 'Hellooo!'}
What's the problem with my code?
I searched online for similar examples but I got the same error! For example this one: https://codehandbook.org/post-data-fastapi/