- Sort Score
- Result 10 results
- Languages All
Results 51 - 60 of 1,174 for respond (0.36 sec)
-
docs/de/docs/tutorial/response-status-code.md
# Response-Statuscode So wie ein Responsemodell, können Sie auch einen HTTP-Statuscode für die Response deklarieren, mithilfe des Parameters `status_code`, und zwar in jeder der *Pfadoperationen*: * `@app.get()` * `@app.post()` * `@app.put()` * `@app.delete()` * usw. ```Python hl_lines="6" {!../../../docs_src/response_status_code/tutorial001.py!} ``` !!! note "Hinweis"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Apr 02 02:32:57 GMT 2024 - 4.7K bytes - Viewed (0) -
tests/test_serialize_response.py
] client = TestClient(app) def test_valid(): response = client.get("/items/valid") response.raise_for_status() assert response.json() == {"name": "valid", "price": 1.0, "owner_ids": None} def test_coerce(): response = client.get("/items/coerce") response.raise_for_status() assert response.json() == {"name": "coerce", "price": 1.0, "owner_ids": None} def test_validlist():
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Mon Aug 03 12:29:07 GMT 2020 - 1.4K bytes - Viewed (0) -
tests/test_serialize_response_dataclass.py
def test_coerce(): response = client.get("/items/coerce") response.raise_for_status() assert response.json() == { "name": "coerce", "date": datetime(2021, 7, 26).isoformat(), "price": 1.0, "owner_ids": None, } def test_validlist(): response = client.get("/items/validlist") response.raise_for_status() assert response.json() == [ {
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Aug 26 13:56:47 GMT 2022 - 4.9K bytes - Viewed (0) -
tests/test_validate_response.py
def test_valid_none_data(): response = client.get("/items/validnone") data = response.json() assert response.status_code == 200 assert data == {"name": "invalid", "price": 3.2, "owner_ids": None} def test_valid_none_none(): response = client.get("/items/validnone", params={"send_none": "true"}) data = response.json() assert response.status_code == 200 assert data is None
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 2K bytes - Viewed (0) -
docs/ko/docs/tutorial/response-status-code.md
## 이름을 기억하는 쉬운 방법 상기 예시 참고: ```Python hl_lines="6" {!../../../docs_src/response_status_code/tutorial001.py!} ``` `201` 은 "생성됨"를 의미하는 상태 코드입니다. 하지만 모든 상태 코드들이 무엇을 의미하는지 외울 필요는 없습니다. `fastapi.status` 의 편의 변수를 사용할 수 있습니다. ```Python hl_lines="1 6" {!../../../docs_src/response_status_code/tutorial002.py!} ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu May 12 00:06:16 GMT 2022 - 4.8K bytes - Viewed (0) -
docs/pt/docs/tutorial/response-status-code.md
Vamos ver o exemplo anterior novamente: ```Python hl_lines="6" {!../../../docs_src/response_status_code/tutorial001.py!} ``` `201` é o código de status para "Criado". Mas você não precisa memorizar o que cada um desses códigos significa. Você pode usar as variáveis de conveniência de `fastapi.status`. ```Python hl_lines="1 6" {!../../../docs_src/response_status_code/tutorial002.py!} ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Mon Oct 31 16:22:07 GMT 2022 - 4.3K bytes - Viewed (0) -
docs/zh/docs/tutorial/response-status-code.md
再看下之前的例子: ```Python hl_lines="6" {!../../../docs_src/response_status_code/tutorial001.py!} ``` `201` 表示**已创建**的状态码。 但我们没有必要记住所有代码的含义。 可以使用 `fastapi.status` 中的快捷变量。 ```Python hl_lines="1 6" {!../../../docs_src/response_status_code/tutorial002.py!} ``` 这只是一种快捷方式,具有相同的数字代码,但它可以使用编辑器的自动补全功能: <img src="../../../../../../img/tutorial/response-status-code/image02.png"> !!! note "技术细节"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 22:40:18 GMT 2024 - 3.7K bytes - Viewed (0) -
docs/em/docs/tutorial/response-status-code.md
```Python hl_lines="6" {!../../../docs_src/response_status_code/tutorial001.py!} ``` `201` 👔 📟 "✍". ✋️ 👆 🚫 ✔️ ✍ ⚫️❔ 🔠 👉 📟 ⛓. 👆 💪 ⚙️ 🏪 🔢 ⚪️➡️ `fastapi.status`. ```Python hl_lines="1 6" {!../../../docs_src/response_status_code/tutorial002.py!} ``` 👫 🏪, 👫 🧑🤝🧑 🎏 🔢, ✋️ 👈 🌌 👆 💪 ⚙️ 👨🎨 📋 🔎 👫: <img src="/img/tutorial/response-status-code/image02.png"> !!! note "📡 ℹ"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Apr 01 09:26:04 GMT 2023 - 3.4K bytes - Viewed (0) -
docs/ja/docs/tutorial/response-status-code.md
## 名前を覚えるための近道 先ほどの例をもう一度見てみましょう: ```Python hl_lines="6" {!../../../docs_src/response_status_code/tutorial001.py!} ``` `201`は「作成完了」のためのステータスコードです。 しかし、それぞれのコードの意味を暗記する必要はありません。 `fastapi.status`の便利な変数を利用することができます。 ```Python hl_lines="1 6" {!../../../docs_src/response_status_code/tutorial002.py!} ``` それらは便利です。それらは同じ番号を保持しており、その方法ではエディタの自動補完を使用してそれらを見つけることができます。
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Mon Jan 15 15:42:08 GMT 2024 - 5.6K bytes - Viewed (0) -
tests/test_response_model_invalid.py
class NonPydanticModel: pass def test_invalid_response_model_raises(): with pytest.raises(FastAPIError): app = FastAPI() @app.get("/", response_model=NonPydanticModel) def read_root(): pass # pragma: nocover def test_invalid_response_model_sub_type_raises(): with pytest.raises(FastAPIError): app = FastAPI()
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Feb 29 13:04:35 GMT 2020 - 1.1K bytes - Viewed (0)