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

    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, …

  2. Video Streaming App using FastAPI and OpenCV - Stack Overflow

    Aug 31, 2020 · Below are given two options (with complete code samples) on how to stream (live) video using FastAPI and OpenCV. Option 1 demonstrates an approach based on your …

  3. fastapi @app.on_event decorator is deprecated, how can I create a ...

    Feb 22, 2024 · I have the following decorator that works perfectly, but fastapi says @app.on_event ("startup") is deprecated, and I'm unable to get @repeat_every () to work with …

  4. Python: FastAPI error 422 with POST request when sending JSON …

    Jan 27, 2020 · Below are given various approaches on how to define a FastAPI endpoint that is expecting JSON data. Also, Python and JavaScript HTTP client examples are provided, in …

  5. How to initialize a global object or variable and reuse it in every ...

    from fastapi import FastAPI, Request from contextlib import asynccontextmanager @asynccontextmanager async def lifespan(app: FastAPI): ''' Run at startup Initialize the Client …

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

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

    Oct 25, 2023 · Add startup/shutdown handlers to FastAPI app with lifespan API Asked 2 years ago Modified 1 year, 5 months ago Viewed 21k times

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

  9. FastAPI asynchronous background tasks blocks other requests?

    May 19, 2021 · I want to run a simple background task in FastAPI, which involves some computation before dumping it into the database. However, the computation would block it …

  10. FastAPI - Unable to render Swagger in production

    Feb 18, 2022 · I faced the same problem having a similar architecture: nginx proxying fastapi running on port 8000 through the /api path. I was able to solve the problem using the …