Where is mistake in FastApi?
Error is:
@video_router.post('/info')
TypeError: post() missing 1 required positional argument: 'path'
api.py
from fastapi import APIRouter
video_router = APIRouter
@video_router.post('/info')
async def info_set(info: UploadVideo):
return info
main.py:
from fastapi import FastAPI
from api import video_router
app = FastAPI()
app.include_router(video_router)
The issue is here.
video_router = APIRouter
video_router
must be an instance of APIRouter
class not the reference to the class itself. So change it to
video_router = APIRouter()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With