- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for Optional (0.23 sec)
-
docs/en/docs/tutorial/query-params.md
http://127.0.0.1:8000/items/?skip=20 ``` The parameter values in your function will be: * `skip=20`: because you set it in the URL * `limit=10`: because that was the default value ## Optional parameters The same way, you can declare optional query parameters, by setting their default to `None`: === "Python 3.10+" ```Python hl_lines="7" {!> ../../../docs_src/query_params/tutorial002_py310.py!} ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Oct 20 09:08:42 GMT 2023 - 5.1K bytes - Viewed (0) -
docs/fr/docs/tutorial/query-params.md
!!! note **FastAPI** saura que `q` est optionnel grâce au `=None`. Le `Optional` dans `Optional[str]` n'est pas utilisé par **FastAPI** (**FastAPI** n'en utilisera que la partie `str`), mais il servira tout de même à votre éditeur de texte pour détecter des erreurs dans votre code.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Wed Sep 27 20:52:31 GMT 2023 - 5.8K bytes - Viewed (0) -
docs/zh/docs/tutorial/query-params.md
本例中,查询参数 `q` 是可选的,默认值为 `None`。 !!! check "检查" 注意,**FastAPI** 可以识别出 `item_id` 是路径参数,`q` 不是路径参数,而是查询参数。 !!! note "笔记" 因为默认值为 `= None`,FastAPI 把 `q` 识别为可选参数。 FastAPI 不使用 `Optional[str]` 中的 `Optional`(只使用 `str`),但 `Optional[str]` 可以帮助编辑器发现代码中的错误。 ## 查询参数类型转换 参数还可以声明为 `bool` 类型,FastAPI 会自动转换参数类型: ```Python hl_lines="9" {!../../../docs_src/query_params/tutorial003.py!} ``` 本例中,访问: ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 4.6K bytes - Viewed (0) -
docs/de/docs/tutorial/query-params.md
http://127.0.0.1:8000/items/?skip=20 ``` gehen, werden die Parameter-Werte Ihrer Funktion sein: * `skip=20`: da Sie das in der URL gesetzt haben * `limit=10`: weil das der Defaultwert ist ## Optionale Parameter Auf die gleiche Weise können Sie optionale Query-Parameter deklarieren, indem Sie deren Defaultwert auf `None` setzen: === "Python 3.10+" ```Python hl_lines="7" {!> ../../../docs_src/query_params/tutorial002_py310.py!}
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jan 25 14:53:41 GMT 2024 - 5.6K bytes - Viewed (0) -
docs/es/docs/tutorial/query-params.md
``` En este caso el parámetro de la función `q` será opcional y será `None` por defecto. !!! check "Revisa" También puedes notar que **FastAPI** es lo suficientemente inteligente para darse cuenta de que el parámetro de path `item_id` es un parámetro de path y que `q` no lo es, y por lo tanto es un parámetro de query. !!! note "Nota" FastAPI sabrá que `q` es opcional por el `= None`.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 5.1K bytes - Viewed (0) -
docs/pt/docs/tutorial/query-params.md
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 5.6K bytes - Viewed (0)