About 8,400,000 results
Open links in new tab
  1. python - How to create a FastAPI endpoint that can accept either File ...

    Dec 31, 2024 · 8 I would like to create an endpoint in FastAPI that might receive either multipart/form-data or JSON body. Is there a way I can make such an endpoint accept either, or detect which type …

  2. Python FastAPI base path control - Stack Overflow

    Dec 3, 2021 · When I use FastAPI , how can I sepcify a base path for the web-service? To put it another way - are there arguments to the FastAPI object that can set the end-point and any others I define, to …

  3. python - How can I install fastapi properly? - Stack Overflow

    Dec 26, 2021 · The OP is trying to install fastapi[all] which seems to require compiling from source. No, I don't agree with you, I just provided the viable solution and I use it all the time. Thanks. The question …

  4. Add startup/shutdown handlers to FastAPI app with lifespan API

    Oct 25, 2023 · app.mount(mount_path, sub_app) How can I register startup/shutdown handlers for the sub app? All solutions I could find either require control over the lifespan generator (which I don't …

  5. How to get the raw URL path from request in FastAPI?

    May 12, 2022 · As FastAPI is actually Starlette underneath, with a layer of several tools on top, you can use Starlette's Request object directly when you need to. Thus, you can use Request object to get …

  6. How can I run the FastAPI server using Pycharm? - Stack Overflow

    Jul 12, 2020 · uvicorn main:app Since we are not calling any python file directly, it is not possible to call uvicorn command from Pycharm. So, How can I run the fast-api server using Pycharm?

  7. FastAPI/uvicorn not working when specifying host [duplicate]

    The FastAPI/uvicorn server is not working when specifying the host.

  8. How to customize error response in FastAPI? - Stack Overflow

    Feb 2, 2022 · I tried to put the line app=FastAPI() in a try-catch block, however, it doesn't work. Is there any way I can handle this issue with own response instead of the above mentioned auto response?

  9. FastAPI - adding route prefix to TestClient - Stack Overflow

    Sep 13, 2021 · I have a FastAPI app with a route prefix as /api/v1. When I run the test it throws 404. I see this is because the TestClient is not able to find the route at /ping, and works perfectly when the …

  10. What are the best practices for structuring a FastAPI project?

    Nov 21, 2020 · The problem that I want to solve related the project setup: Good names of directories so that their purpose is clear. Keeping all project files (including virtualenv) in one place, so I can easily...