Hello Stackoverflow Community,
I have a FastAPI based Python get request, where I wish to capture image URL as parameter. The following is the code snippet:
@app.get("/v1/image/{image_name}")
async def image_resize(image_name:str):
image_file_name = image_name.split("/")[-1]
Intended URL is like http://localhost:8000/v1/image/https://www.freeimages.com/photo/circulate-abstract-1562332.jpg
where the image source URL is https://www.freeimages.com/photo/circulate-abstract-1562332.jpg
however, I am getting 404
INFO: 127.0.0.1:58611 - "GET /v1/image/https%3A//www.freeimages.com/photo/circulate-abstract-1562332.jpg HTTP/1.1" 404 Not Found
What would be the correct way to accept URL as request parameter. This service would be called by another API for sending the image source. Please feel free to suggest any better option to accept the URL.
Thank you in anticipation