Skip to content
Discussion options

You must be logged in to vote

@growwithsundar You cannot send the data as a json in form fields. It needs to be sent as a stringified JSON and on the FastAPI side, you need convert this to your desired object.

Form fields work okay for simple datatypes.

See the link for reference: https://stackoverflow.com/questions/60127234/how-to-use-a-pydantic-model-with-form-data-in-fastapi

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem question-migrate
3 participants
Converted from issue

This discussion was converted from issue #4555 on February 27, 2023 22:00.