Category "fastapi"

Header x-rapidapi-proxy-secret not forwarded by Heroku

I wrote and API with RapidAPI and deployed it on Heroku. I then listed the API on RapidAPI marketplace which uses a x-rapidapi-proxy-secret header to help me ma

fastapi : save image from response body

I want to save an image from the response body to my local directory. Here is my code: return Response(bytes_io.getvalue(), media_type= "image/jpeg")

Upload single image from axios to FastAPI: "Expected UploadFile, received: <class 'str'>"

I try to upload an image from my react-admin app to FastAPI using axios. The ImageInput component returns a File object which I cast to a Blob and try to upload

PendingRollbackError when accessing test database in FastAPI async test

I'm trying to mimic Django behavior when running tests on FastAPI: I want to create a test database in the beginning of each test, and destroy it in the end. Th

FastAPI asynchronous background tasks blocks other requests?

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

Interaction Between Flutter and FastAPI

Ubuntu 20.04LTS, with Python 3.8 for FastAPI, and Flutter 2.8.1, with Android SDK version 32.0.0. I am trying to send a Map from Flutter to FastAPI. I have figu

How to redirect the user back to the home page using FastAPI, after submitting an HTML form?

I have a page with a table of students. I added a button that allows you to add a new row to the table. To do this, I redirect the user to a page with input for

Problem with FastAPI patch request from Javascript

I made a REST service on python using FastAPI and I need to call the API using Javascript. This is my FastAPI server: class FieldUpdate(BaseModel): item_id: Opt

FastAPI serving static files through symlinks

I have mounted the static directory in my FastAPI app using the following code: from fastapi.staticfiles import StaticFiles app = FastAPI( title="Title of

How to redirect to dynamic URL inside FastAPI endpoint

I'm doing a feature where the user on their profile page makes changes (not related to the user model). Everything is implemented through static HTML templates.

FastAPI not loading static files

So, I'm swapping my project from node.js to python FastAPI. Everything has been working fine with node, but here it says that my static files are not present, s

Upload a CSV file in FastAPI and convert it into JSON format

I am trying to convert my CSV file into JSON by uploading it into FastAPI first, but when I try to process it directly (without storing it somewhere), I get err

Behavior-Driven Development(BDD) Testing with Fast API python web framework

I want to write BDD test cases for the Fast API framework where I have written some REST API. Though for normal test cases Fast API mentioned pytest package. Ba

FastAPI + MongoDB ValueError: [TypeError("'ObjectId' object is not iterable")

I try to insert data to my MongoDB Database after scraping data. I did the exact same thing with NodeJS and Express, now I'm testing FastAPI. URI = '...' try:

Exception in ASGI application Of FastAPI

I'm using FastAPI and the following error is reported, but I don't know where the error is when I'm tracing. I have read this link, but it's no use: https://sta

The alias field of the Pydantic Model schema is by default in swagger instead of the original field

I need to receive data from an external platform (cognito) that uses PascalCase, and the Pydantic model supports this through field aliases, adding an alias_gen

Reading Cookie from React (backend with FastAPI + fastapi-jwt-auth)

I am having some problems with understanding JWT in Cookie using Axios and FastAPI. I am trying to make a simple application with React for the frontend and Fas

How to post an image file with a list of strings using FastAPI?

I have tried a lot of things, but it doesn't seem to work. Here is my code: @app.post("/my-endpoint") async def my_func( languages: List[str] = ["en", "hi"]

FastAPI Textarea OpenAPI for Form Data

I am using Form Data format for APIs. The thing is how I am going to make OpenAPI input being larger by using textarea?

FastAPI - Dataframe updated change lost between route

I'm trying to make a simple FastAPI api. Let's suppose these routes: The POST Route @api.post('/user', name='Get list of users') def get_user(user: User):