I have a code which has two endpoints. One is root and the other one is root with query parameters. However, when I call the second endpoint I am unable to get it called. It is always the first endpoint that gets called. Even if I change the order of endpoints, the second one is still unreachable.
from fastapi import APIRouter
router = APIRouter()
@router.get('/')
def index():
return 'Call like https://localhost:5000/?uname=xyz&uemail=abc@xyz.com'
@router.get('/')
def index(uname,uemail):
return ('User Name is :' + uname + 'and User Email is: '+ uemail)
I am expecting the second function to be called, when the root path is called with query parameters.