mirror of https://github.com/tiangolo/fastapi.git
📝 Update includes in `docs/en/docs/advanced/additional-status-codes.md` (#12577)
This commit is contained in:
parent
9106cae8a8
commit
dc7cf0f14f
|
|
@ -14,57 +14,7 @@ But you also want it to accept new items. And when the items didn't exist before
|
||||||
|
|
||||||
To achieve that, import `JSONResponse`, and return your content there directly, setting the `status_code` that you want:
|
To achieve that, import `JSONResponse`, and return your content there directly, setting the `status_code` that you want:
|
||||||
|
|
||||||
//// tab | Python 3.10+
|
{* ../../docs_src/additional_status_codes/tutorial001_an_py310.py hl[4,25] *}
|
||||||
|
|
||||||
```Python hl_lines="4 25"
|
|
||||||
{!> ../../docs_src/additional_status_codes/tutorial001_an_py310.py!}
|
|
||||||
```
|
|
||||||
|
|
||||||
////
|
|
||||||
|
|
||||||
//// tab | Python 3.9+
|
|
||||||
|
|
||||||
```Python hl_lines="4 25"
|
|
||||||
{!> ../../docs_src/additional_status_codes/tutorial001_an_py39.py!}
|
|
||||||
```
|
|
||||||
|
|
||||||
////
|
|
||||||
|
|
||||||
//// tab | Python 3.8+
|
|
||||||
|
|
||||||
```Python hl_lines="4 26"
|
|
||||||
{!> ../../docs_src/additional_status_codes/tutorial001_an.py!}
|
|
||||||
```
|
|
||||||
|
|
||||||
////
|
|
||||||
|
|
||||||
//// tab | Python 3.10+ non-Annotated
|
|
||||||
|
|
||||||
/// tip
|
|
||||||
|
|
||||||
Prefer to use the `Annotated` version if possible.
|
|
||||||
|
|
||||||
///
|
|
||||||
|
|
||||||
```Python hl_lines="2 23"
|
|
||||||
{!> ../../docs_src/additional_status_codes/tutorial001_py310.py!}
|
|
||||||
```
|
|
||||||
|
|
||||||
////
|
|
||||||
|
|
||||||
//// tab | Python 3.8+ non-Annotated
|
|
||||||
|
|
||||||
/// tip
|
|
||||||
|
|
||||||
Prefer to use the `Annotated` version if possible.
|
|
||||||
|
|
||||||
///
|
|
||||||
|
|
||||||
```Python hl_lines="4 25"
|
|
||||||
{!> ../../docs_src/additional_status_codes/tutorial001.py!}
|
|
||||||
```
|
|
||||||
|
|
||||||
////
|
|
||||||
|
|
||||||
/// warning
|
/// warning
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue