About 3,370,000 results
Open links in new tab
  1. python - How to create a FastAPI endpoint that can accept either …

    Oct 10, 2022 · 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, …

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

    Dec 26, 2021 · It is also very easy to install. # install command pip install poetry # Verify the installed version poetry --version poetry add fastapi uvicorn[standard] # zsh USE: poetry add …

  3. 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 …

  4. python - How do I return an image in FastAPI? - Stack Overflow

    Apr 26, 2019 · Learn how to return an image in FastAPI using Python with practical examples and solutions.

  5. How to create routes with FastAPI within a class

    Sep 11, 2020 · So I need to have some routes inside a class, but the route methods need to have the self attr (to access the class' attributes). However, FastAPI then assumes self is its own …

  6. Is there any way to have multiple response models in …

    Jul 9, 2022 · I am writing an app where I need to have two completely different set of response structures depending on logic. Is there any way to handle this so that I can have two different …

  7. python - How to return plain text in FastAPI - Stack Overflow

    Dec 20, 2023 · When you return a string from a FastAPI endpoint, FastAPI will automatically convert it to a JSON response, which is why the quotes are being escaped in your example. …

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

    Oct 25, 2023 · Add startup/shutdown handlers to FastAPI app with lifespan API Asked 1 year, 8 months ago Modified 1 year, 1 month ago Viewed 20k times

  9. FastAPI - passing an input to a LangGraph model and getting an …

    Aug 31, 2024 · To turn this into a web application with a user-facing interface, you would need to create the necessary HTML and form and possibly some javascript to handle the form …

  10. How to do session-based authentication when combining FastAPI …

    Jun 16, 2024 · For the backend of a project, we are combining FastAPI and Django. Why FastAPI? We need to use WebSockets and FastAPI supports that natively We like the …