I have a simple route as below that written in FastAPI,
from fastapi import FastAPI
app = FastAPI()
@app.get("/foo/bar/{rand_int}/foo-bar/")
async def main(rand_int: int):
return {"path": f"https://some-domain.com/foo/bar/{rand_int}/foo-bar/?somethig=foo"}
How can I get the current path "programmatically" with,
- domain (
some-domain.com
) - path (
/foo/bar/{rand_int}/foo-bar/
) - and query parameters (
?somethig=foo
)