Error getting request body: The `python-multipart` library must be installed to use form parsing.
See original GitHub issue(venv) G:\projects\python\fastprojects>pip list
python-dateutil 2.8.1 python-multipart 0.0.5 rope 0.17.0
@app.post('/token', tags=['safe'])
async def login(form_data: OAuth2PasswordRequestForm = Depends()):
print('form_data', form_data)
user_dict = fake_users_db.get(form_data.username)
if not user_dict:
raise HTTPException(
status_code=400,
detail='Incorrect username or password'
)
user = UserInDB(**user_dict)
hashed_password = fake_hash_password(form_data.password)
if not hashed_password == user.hashed_password:
raise HTTPException(
status_code=400,
detail='Incorrect username or password'
)
return {'access_token': user.username, 'token_type': 'bearer'}
I don’t know how to troubleshoot this problem
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (9 by maintainers)
Top Results From Across the Web
The `python-multipart` library must be installed to use form ...
The full stack is: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/uvicorn/protocols/http/httptools_impl.py" ...
Read more >Errror parsing data in python FastAPI - Stack Overflow
I acomplished to figure out, it was because when FastAPI was installed, it didn't install python-multipart, so with this package missing ...
Read more >Form Data - FastAPI
To use forms, first install python-multipart . ... to receive as JSON, as the request will have the body encoded using application/x-www-form-urlencoded ...
Read more >tiangolo/fastapi - Gitter
From what I saw the python-arango library makes use of a requests. ... the test getting message like {'detail': 'There was an error...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The error output instructs the user to install
python-multipart, instead ofmultipart.It’s also possible that both need to be installed.
Thanks for the help here @Kludex ! 👏 🙇
I understand you solved your problem, so thanks for reporting back and closing the issue @q98765543221 👍