Category "fastapi"

How to send multiple files with Python requests to FastAPI server?

I have the following endpoint in my FastAPI server: @app.post("/submit") async def submit(file1: List[UploadFile] = File(...), file2: List[UploadFile] = File(..

How to run a uvicorn server (using FastAPI) and a load test (using locust) parallely?

I have two files, both of them runs individually without any error. I used FastAPI to create some endpoints and I am trying to use locust (through a tool invoku

How to get query data converting foreign table's another column

I'm now using sqlalchemy, fastapi develop some REST API. And facing some problem to join multiple tables I have 2 tables as below [campaigns] class Campaign(Bas

How to POST multiple images to FastAPI server using Python requests?

I would like to send multiple images to FastAPI backend using Python requests. Server side from fastapi import FastAPI, UploadFile, File from typing import List

fastapi using ORM not able to convert to pandas

I've been developing a fastapi way to query my database, instead of directly using SQL with pg. For some reason, I'm having issues converting the ORM query retu

FastAPI server returns "422 unprocessable entity" - value_error.missing

from http.client import responses from random import randrange from tkinter.tix import STATUS from typing import Optional from urllib import response from fasta

How to handle extra data error in FastAPI

So I have the following FastAPI code: from fastapi import FastAPI app = FastAPI class Demo(BaseModel): content: str = None @app.post("/demo") async d

How to Pass Authorization Header from Swagger Doc in Python Fast API

I am trying to pass authorization header using Documentation page, similar to this page: Since, the documentations are automatic generated in Fast API, I am ha

How can I POST data in real time using FastAPI?

I built a simple demo project using FastAPI. I would like to POST data to the server in real time (maybe 30fps). # in client while True: .... res = requ

Python websocket with FastAPI does not return data immediately

I created a websocket connection with FastAPI to "stream" data which comes from a tedious calculation. The data chunks should be send as soon as they are availa

FastApi returns "field required" and "value_error.missing" for one of my parameters, but the field is there

I do a Post with some parameters, but one of them returns "field required" and "value_error.missing", but the field is there and it has a value. See the output

Error uploading file to google cloud storage

How should the files on my server be uploaded to google cloud storage? the code I have tried is given below, however, it throws a type error, saying, the expect

how to convert sql query to sqlalchemy in python fatsapi

SELECT * FROM order_trade join credential as buyer on buyer.user_id = order_trade.buyer_id join credential as seller on seller.user_id = order_trade.seller_id

Python FastAPI backend get request path operation function access data saved outside of the function

I am quite new to FastAPI, so I have a question if it is possible to access data within the path operation function, which(data) is stored/generated outside of

FastApi urls path and 2 values into a query

im using FastApi and get some troubles with url. i have a root url @app.get("/myurl") http://host/myurl and http://host/myurl?id=2 and here function returns

in many-to-many relationships, can you delete a row from one table without deleting any rows from the second table?

I am creating a database & working on CRUD functions. I've run into a problem with the Delete functionality. I have two tables, connected in a many-to-many

How do I serve a React-built front-end on a FastAPI backend?

I've tried to mount the frontend to / with app.mount, but this invalidates all of my /api routes. I've also tried the following code to mount the folders in /st

Download PDF file using pdfkit and FastAPI

I am going to create an API that converts an HTML page to a PDF file. I made it using pdfkit and FastAPI. However, it saves the file to my local disk. After I s

Set description for query parameter in swagger doc using Pydantic model (FastAPI)

This is continue to this question. I have added a model to get query params to pydantic model class QueryParams(BaseModel): x: str = Field(description="quer

Celery, uvicorn and FastAPI

I have a FastAPI api code that is executed using uvicorn. Now I want to add a queu system, and I think Celery and Flower can be great tools for me since my api