Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 407 for COde (0.13 sec)

  1. docs/de/docs/tutorial/response-status-code.md

    * `@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)
  2. docs/zh/docs/tutorial/response-status-code.md

    与指定响应模型的方式相同,在以下任意*路径操作*中,可以使用 `status_code` 参数声明用于响应的 HTTP 状态码:
    
    * `@app.get()`
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    * 等……
    
    ```Python hl_lines="6"
    {!../../../docs_src/response_status_code/tutorial001.py!}
    ```
    
    !!! note "笔记"
    
        注意,`status_code` 是(`get`、`post` 等)**装饰器**方法中的参数。与之前的参数和请求体不同,不是*路径操作函数*的参数。
    
    `status_code` 参数接收表示 HTTP 状态码的数字。
    
    !!! info "说明"
    
    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)
  3. docs/ja/docs/tutorial/response-status-code.md

    * `@app.get()`
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    * など。
    
    ```Python hl_lines="6"
    {!../../../docs_src/response_status_code/tutorial001.py!}
    ```
    
    !!! note "備考"
        `status_code`は「デコレータ」メソッド(`get`、`post`など)のパラメータであることに注意してください。すべてのパラメータやボディのように、*path operation関数*のものではありません。
    
    `status_code`パラメータはHTTPステータスコードを含む数値を受け取ります。
    
    !!! info "情報"
    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)
  4. docs/en/docs/advanced/response-change-status-code.md

    You probably read before that you can set a default [Response Status Code](../tutorial/response-status-code.md){.internal-link target=_blank}.
    
    But in some cases you need to return a different status code than the default.
    
    ## Use case
    
    For example, imagine that you want to return an HTTP status code of "OK" `200` by default.
    
    But if the data didn't exist, you want to create it, and return an HTTP status code of "CREATED" `201`.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  5. docs/es/docs/advanced/response-change-status-code.md

    # Response - Cambiar el Status Code
    
    Probablemente ya has leído con anterioridad que puedes establecer un [Response Status Code](../tutorial/response-status-code.md){.internal-link target=_blank} por defecto.
    
    Pero en algunos casos necesitas retornar un status code diferente al predeterminado.
    
    ## Casos de uso
    
    Por ejemplo, imagina que quieres retornar un HTTP status code de "OK" `200` por defecto.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Feb 06 19:56:23 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  6. docs/de/docs/advanced/response-change-status-code.md

    Anschließend können Sie den `status_code` in diesem *vorübergehenden* Response-Objekt festlegen.
    
    ```Python hl_lines="1  9  12"
    {!../../../docs_src/response_change_status_code/tutorial001.py!}
    ```
    
    Und dann können Sie wie gewohnt jedes benötigte Objekt zurückgeben (ein `dict`, ein Datenbankmodell usw.).
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:18:58 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  7. docs/em/docs/tutorial/metadata.md

    | `contact` | `dict` | 📧 ℹ 🎦 🛠️. ⚫️ 💪 🔌 📚 🏑. <details><summary><code>contact</code> 🏑</summary><table><thead><tr><th>🔢</th><th>🆎</th><th>📛</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>str</code></td><td>⚖ 📛 📧 👨‍💼/🏢.</td></tr><tr><td><code>url</code></td><td><code>str</code></td><td>📛 ☝ 📧 ℹ. 🔜 📁 📛.</td></tr><tr><td><code>email</code></td><td><code>str</code></td><td>📧 📢 📧 👨‍💼/🏢. 🔜 📁 📧 📢. </td></tr></tbody></table></details> |
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  8. tests/test_query.py

        assert response.status_code == 200
        assert response.json() == "foo bar"
    
    
    def test_query_param_query_50():
        response = client.get("/query/param?query=50")
        assert response.status_code == 200
        assert response.json() == "foo bar 50"
    
    
    def test_query_param_required():
        response = client.get("/query/param-required")
        assert response.status_code == 422
        assert response.json() == IsDict(
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_body/test_tutorial001_py310.py

        assert response.status_code == 200
        assert response.json() == {
            "name": "Foo",
            "price": 50.5,
            "description": None,
            "tax": None,
        }
    
    
    @needs_py310
    def test_post_with_str_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": "50.5"})
        assert response.status_code == 200
        assert response.json() == {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 15K bytes
    - Viewed (2)
  10. tests/test_tutorial/test_body/test_tutorial001.py

        assert response.status_code == 200
        assert response.json() == {
            "name": "Foo",
            "price": 50.5,
            "description": None,
            "tax": None,
        }
    
    
    def test_post_with_str_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": "50.5"})
        assert response.status_code == 200
        assert response.json() == {
            "name": "Foo",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 14.7K bytes
    - Viewed (7)
Back to top