Is there a way to put a parameter that is part of the URL but it has forward-slashes?
For example:
from fastapi import FastAPI
app = FastAPI()
@app.get("/items/{path}")
def read_root(path:str="/inventory/armor/helmet):
return path
With that route above, if I put example.com/items/this/is/my/path I get a 404.
thanks for the reply; I've put the {path} as a query string parameter now.
@app.get("/items")
def read_root(k:str =Query(None)):
return path
This works and seems safe.
Thanks for the help here @Kludex! :clap: :bow:
Thanks for reporting back and closing the issue @NickDatLe :+1: