- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 699 for body (0.14 sec)
-
docs/ko/docs/tutorial/body-multiple-params.md
## 본문 내의 단일 값 쿼리 및 경로 매개변수에 대한 추가 데이터를 정의하는 `Query`와 `Path`와 같이, **FastAPI**는 동등한 `Body`를 제공합니다. 예를 들어 이전의 모델을 확장하면, `item`과 `user`와 동일한 본문에 또 다른 `importance`라는 키를 갖도록 할 수있습니다. 단일 값을 그대로 선언한다면, **FastAPI**는 쿼리 매개변수로 가정할 것입니다. 하지만, **FastAPI**의 `Body`를 사용해 다른 본문 키로 처리하도록 제어할 수 있습니다: ```Python hl_lines="23" {!../../../docs_src/body_multiple_params/tutorial003.py!} ``` 이 경우에는 **FastAPI**는 본문을 이와 같이 예측할 것입니다:
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sun Feb 11 13:48:31 GMT 2024 - 5.2K bytes - Viewed (0) -
docs/ja/docs/tutorial/body-nested-models.md
```Python hl_lines="12" {!../../../docs_src/body_nested_models/tutorial001.py!} ``` これにより、各項目の型は宣言されていませんが、`tags`はある項目のリストになります。 ## タイプパラメータを持つリストのフィールド しかし、Pythonには型や「タイプパラメータ」を使ってリストを宣言する方法があります: ### typingの`List`をインポート まず、Pythonの標準の`typing`モジュールから`List`をインポートします: ```Python hl_lines="1" {!../../../docs_src/body_nested_models/tutorial002.py!} ``` ### タイプパラメータを持つ`List`の宣言
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 8.7K bytes - Viewed (0) -
docs/en/docs/tutorial/body-multiple-params.md
## Embed a single body parameter Let's say you only have a single `item` body parameter from a Pydantic model `Item`. By default, **FastAPI** will then expect its body directly. But if you want it to expect a JSON with a key `item` and inside of it the model contents, as it does when you declare extra body parameters, you can use the special `Body` parameter `embed`: ```Python item: Item = Body(embed=True) ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Oct 17 05:59:11 GMT 2023 - 7.7K bytes - Viewed (0) -
docs/ru/docs/tutorial/body-nested-models.md
=== "Python 3.10+" ```Python hl_lines="12" {!> ../../../docs_src/body_nested_models/tutorial002_py310.py!} ``` === "Python 3.9+" ```Python hl_lines="14" {!> ../../../docs_src/body_nested_models/tutorial002_py39.py!} ``` === "Python 3.8+" ```Python hl_lines="14" {!> ../../../docs_src/body_nested_models/tutorial002.py!} ``` ## Типы множеств
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 14.9K bytes - Viewed (0) -
docs/de/docs/tutorial/body-nested-models.md
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 10.4K bytes - Viewed (0) -
docs/ja/docs/tutorial/body-multiple-params.md
## ボディ内の単数値 クエリとパスパラメータの追加データを定義するための `Query` と `Path` があるのと同じように、 **FastAPI** は同等の `Body` を提供します。 例えば、前のモデルを拡張して、同じボディに `item` と `user` の他にもう一つのキー `importance` を入れたいと決めることができます。 単数値なのでそのまま宣言すると、**FastAPI** はそれがクエリパラメータであるとみなします。 しかし、`Body`を使用して、**FastAPI** に別のボディキーとして扱うように指示することができます: ```Python hl_lines="23" {!../../../docs_src/body_multiple_params/tutorial003.py!} ``` この場合、**FastAPI** は以下のようなボディを期待します:
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Mon Jan 15 15:48:41 GMT 2024 - 5.8K bytes - Viewed (0) -
docs/pt/docs/tutorial/body-multiple-params.md
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 6K bytes - Viewed (0) -
docs/pt/docs/tutorial/body-nested-models.md
### Defina um sub-modelo Por exemplo, nós podemos definir um modelo `Image`: ```Python hl_lines="9-11" {!../../../docs_src/body_nested_models/tutorial004.py!} ``` ### Use o sub-modelo como um tipo E então podemos usa-lo como o tipo de um atributo: ```Python hl_lines="20" {!../../../docs_src/body_nested_models/tutorial004.py!} ``` Isso significa que o **FastAPI** vai esperar um corpo similar à: ```JSON {
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 7.4K bytes - Viewed (0) -
tests/test_union_body.py
} } }, }, }, "summary": "Save Union Body", "operationId": "save_union_body_items__post", "requestBody": { "content": { "application/json": { "schema": {
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 4.6K bytes - Viewed (0) -
tests/test_multi_body_errors.py
app = FastAPI() class Item(BaseModel): name: str age: condecimal(gt=Decimal(0.0)) # type: ignore @app.post("/items/") def save_item_no_body(item: List[Item]): return {"item": item} client = TestClient(app) def test_put_correct_body(): response = client.post("/items/", json=[{"name": "Foo", "age": 5}]) assert response.status_code == 200, response.text assert response.json() == {
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 7.6K bytes - Viewed (0)