mirror of
https://github.com/fastapi/fastapi.git
synced 2026-07-20 03:43:11 -04:00
📝 Add tip about using alias for form data fields (#5329)
This commit is contained in:
committed by
GitHub
parent
0e1a9d1c0f
commit
adf4e77dd6
@@ -27,7 +27,7 @@ For example, in one of the ways the OAuth2 specification can be used (called "pa
|
||||
|
||||
The <abbr title="specification">spec</abbr> requires the fields to be exactly named `username` and `password`, and to be sent as form fields, not JSON.
|
||||
|
||||
With `Form` you can declare the same metadata and validation as with `Body` (and `Query`, `Path`, `Cookie`).
|
||||
With `Form` you can declare the same configurations as with `Body` (and `Query`, `Path`, `Cookie`), including validation, examples, an alias (e.g. `user-name` instead of `username`), etc.
|
||||
|
||||
!!! info
|
||||
`Form` is a class that inherits directly from `Body`.
|
||||
|
||||
Reference in New Issue
Block a user