Linked Questions
13 questions linked to/from Value is not a valid dict when posting JSON data through Postman to FastAPI backend
1 vote
3 answers
12k views
FastAPI - Postman error 422 Unprocessable Entity [duplicate]
I am using FastAPI to make get/post/put/del requests, which all work perfectly fine in the browser. I wanted to use Postman to do the exact same thing; however, I am running into an issue trying to do ...
2 votes
1 answer
2k views
Why does a ValidationError 422 occur when sending a POST request to a FastAPI app through Postman? [duplicate]
I cannot seem to send a POST request to a FastAPI app through Postman. FastAPI version 0.89.1 Python version 3.10.9 from fastapi import FastAPI from fastapi.params import Body from pydantic import ...
1 vote
1 answer
2k views
Cant send post request via Postman, 422 Unprocessable Entity in Fast API [duplicate]
I am writing because I have a problem with fastAPI and postman. I have this post function @router.post('/', status_code=status.HTTP_201_CREATED) def create(request: schemas.Blog, db: Session = Depends(...
2 votes
0 answers
602 views
FastAPI - "msg": "value is not a valid dict" in schema request [duplicate]
My code: @app.post('/create') async def createUser(request: UserRequest, db: Session = Depends(get_db)): print(request) _user = crud.createUser(db, user_schema=request.parameter) ...
1 vote
0 answers
100 views
FastAPI throws error "value is not a valid dict (type=type_error.dict)" but inserts data in DB [duplicate]
POST throws me an error: value is not a valid dict (type=type_error.dict). What is wrong with my code?? It does however insert data in the DB despite the error. My models.py: class Checkpoint(...
123 votes
13 answers
335k views
Python: FastAPI error 422 with POST request when sending JSON data
I'm building a simple API to test a database. When I use GET request everything works fine, but if I change to POST, I get 422 Unprocessable Entity error. Here is the FastAPI code: from fastapi import ...
10 votes
2 answers
30k views
POST request response 422 error {'detail': [{'loc': ['body'], 'msg': 'value is not a valid dict', 'type': 'type_error.dict'}]}
My POST request continues to fail with 422 response, even though valid JSON is being sent. I am trying to create a web app that receives an uploaded text file with various genetic markers and sends it ...
10 votes
2 answers
13k views
How to POST a JSON having a single body parameter in FastAPI?
I have a file called main.py in which I put a POST call with only one input parameter (integer). Simplified code is given below: from fastapi import FastAPI app = FastAPI() @app.post("/...
5 votes
1 answer
11k views
How to post JSON data from JavaScript frontend to FastAPI backend?
I am trying to pass a value called 'ethAddress' from an input form on the client to FastAPI so that I can use it in a function to generate a matplotlib chart. I am using fetch to POST the inputted ...
3 votes
2 answers
13k views
"There was an error parsing the body" error on requesting endpoint in FastAPI
I have implemented a endpoint in FastAPI and I am testing it from Postman. But whenever I send request I get this error: There was an error parsing the body While searching for the error, I found a ...
1 vote
1 answer
5k views
FastAPI JSON List in body raises 'There was an error parsing the body' exception
Using the FastAPI documentation, I'm attempting to send a POST request to an endpoint that takes a JSON object with a list as input: { "urls":[ "https://www.website.com/", ...
0 votes
2 answers
3k views
422 unprocessable entity in fastapi [duplicate]
I am creating a web app for registration and I am getting 422 unprocessed error. This is my fastapi code: app = FastAPI() Base.metadata.create_all(bind=engine) metadata = Base.metadata origins = [ ...
1 vote
2 answers
1k views
Webhook listener in FastAPI raises 422 Unprocessable Entity error [duplicate]
I have a webhook listener that uses an APIRouter to designate the route for the application on the FastAPI server. The app should receive a POST request (expecting data in JSON format) and log this to ...