All Questions
Tagged with fastapi python-requests
97
questions
0
votes
0
answers
40
views
Is there an issue with parsing UUIDs for GraphQL requests?
I am trying to make some automatic GraphQL API tests using the Starlette TestClient in Python. My issue is that my GraphQL schema has a query that needs a UUID! as an input, say
testQuery(id: UUID!): ...
0
votes
2
answers
118
views
Python requests POST request hangs, when used with websockets library [duplicate]
I'm using the Python requests library to send a POST request, while concurrently maintaining a WebSocket connection with the websockets library:
import asyncio
import requests
import websockets
async ...
0
votes
1
answer
136
views
Send list of lists of floats in request body
I have defined the following endpoint using FastAPI:
@app.post(
"/my_endpoint",
)
async def my_endpoint(
my_matrix: list[list[list[float]]],
):
print(my_matrix)
However, I ...
0
votes
0
answers
17
views
Pydantic model not recognizing multipart POST request in FastAPI [duplicate]
I'm trying to send a POST request a FastAPI endpoint. This request includes both json data and a file.
results = requests.post(
f"http://toing_url:{_e('TOING_PORT')}/toing",
...
2
votes
2
answers
699
views
Why is httpx so much worse than aiohttp when facing high concurrent requests?
In the FastAPI web framework, why is httpx so much worse than aiohttp when facing high concurrent requests? They both reuse the same client instance.
test code
import uvicorn
from fastapi import ...
0
votes
0
answers
15
views
I can't call a FastAPI POST route using Python's "requests" module, but I'm able to call the same route via cURL command line [duplicate]
Below you can find (the relevant excerpt of) my "server-side" FastAPI code.
from fastapi import FastAPI, UploadFile, HTTPException
from fastapi.responses import FileResponse, HTMLResponse, ...
1
vote
0
answers
68
views
Client can contact server on all ports except 8080
I have a client-server python project. I am using fastapi with uvicorn. When I make a request to the server using the requests library or with postman, I get ConnectionResetError. This only takes ...
0
votes
1
answer
67
views
difference between post and get requests [duplicate]
Why should I use a post request instead of get when I add some info in my database like PostgreSQL. I can just put all necessary data in arguments with get request, like this:
@app.get('/...
-1
votes
1
answer
867
views
Python FastAPI multiple method with same route does not work
I am facing trouble with FastAPI when I do multiple method with the same route on a router.
When I define with the decorator @router.get("/route/") and @router.post("/route/") for ...
1
vote
0
answers
559
views
Unable to send WhatsApp messages using FastAPI and requests in Python
I am working on a project using FastAPI to handle incoming WhatsApp messages and respond to them. I've set up the webhook, and I can successfully receive messages. However, I'm encountering issues ...
3
votes
2
answers
973
views
How to post JSON data that include unicode characters to FastAPI using Python requests?
When a FastAPI endpoint expects a Pydantic model and one is passed with a string it works as expected unless that string contains unicode characters.
First I create an example application for FastAPI ...
0
votes
1
answer
198
views
Error 500 when calling Post method using FastAPI on Vercel
I'm using React on the frontend and Fastapi on the backend
main.py
from typing import Union
from fastapi import FastAPI
from fastapi.encoders import jsonable_encoder
from fastapi.middleware.cors ...
0
votes
0
answers
107
views
importing requests module throws error in FastAPI application
I'm using Python3.8, creating a FastAPI application and trying to import requests module. This throws error "ModuleNotFoundError: No module named 'requests'"
However, in the Python terminal, ...
0
votes
1
answer
674
views
reading image bytes in fastAPI
I have a Python fastAPI server with the following post request function. This function should read an image in the form of bytes and use facebook's nougat OCR model to convert the image into text.
@...
0
votes
0
answers
16
views
Query FastAPI with python requests returns 422 unprocessable entity [duplicate]
I am trying to reach a fastAPI endpoint using the python requests, however, any request always returns a 422 Unprocessable Entity error. I have looked at other similar posts, such as this one, but to ...