Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 28 for 404 (0.14 sec)

  1. docs/fr/docs/advanced/additional-responses.md

    **FastAPI** prendra ce modèle, générera son schéma JSON et l'inclura au bon endroit dans OpenAPI.
    
    Par exemple, pour déclarer une autre réponse avec un code HTTP `404` et un modèle Pydantic `Message`, vous pouvez écrire :
    
    ```Python hl_lines="18 22"
    {!../../../docs_src/additional_responses/tutorial001.py!}
    ```
    
    !!! note "Remarque"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 9.6K bytes
    - Viewed (0)
  2. docs/zh/docs/tutorial/handling-errors.md

    需要向客户端返回错误提示的场景主要如下:
    
    - 客户端没有执行操作的权限
    - 客户端没有访问资源的权限
    - 客户端要访问的项目不存在
    - 等等 ...
    
    遇到这些情况时,通常要返回 **4XX**(400 至 499)**HTTP 状态码**。
    
    **4XX** 状态码与表示请求成功的 **2XX**(200 至 299) HTTP 状态码类似。
    
    只不过,**4XX** 状态码表示客户端发生的错误。
    
    大家都知道**「404 Not Found」**错误,还有调侃这个错误的笑话吧?
    
    ## 使用 `HTTPException`
    
    向客户端返回 HTTP 错误响应,可以使用 `HTTPException`。
    
    ### 导入 `HTTPException`
    
    ```Python hl_lines="1"
    {!../../../docs_src/handling_errors/tutorial001.py!}
    
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  3. docs/zh/docs/advanced/additional-responses.md

    您可以向路径操作装饰器传递参数 `responses` 。
    
    它接收一个 `dict`,键是每个响应的状态代码(如`200`),值是包含每个响应信息的其他 `dict`。
    
    每个响应字典都可以有一个关键模型,其中包含一个 `Pydantic` 模型,就像 `response_model` 一样。
    
    **FastAPI**将采用该模型,生成其`JSON Schema`并将其包含在`OpenAPI`中的正确位置。
    
    例如,要声明另一个具有状态码 `404` 和`Pydantic`模型 `Message` 的响应,可以写:
    ```Python hl_lines="18  22"
    {!../../../docs_src/additional_responses/tutorial001.py!}
    ```
    
    
    !!! Note
    	请记住,您必须直接返回 `JSONResponse` 。
    
    !!! Info
    	`model` 密钥不是OpenAPI的一部分。
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 09 15:53:39 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  4. docs/em/docs/tutorial/response-status-code.md

    * **`300`** & 🔛 "❎". 📨 ⏮️ 👫 👔 📟 5️⃣📆 ⚖️ 5️⃣📆 🚫 ✔️ 💪, 🌖 `304`, "🚫 🔀", ❔ 🔜 🚫 ✔️ 1️⃣.
    * **`400`** & 🔛 "👩‍💻 ❌" 📨. 👫 🥈 🆎 👆 🔜 🎲 ⚙️ 🏆.
        * 🖼 `404`, "🚫 🔎" 📨.
        * 💊 ❌ ⚪️➡️ 👩‍💻, 👆 💪 ⚙️ `400`.
    * `500` & 🔛 💽 ❌. 👆 🌖 🙅 ⚙️ 👫 🔗. 🕐❔ 🕳 🚶 ❌ 🍕 👆 🈸 📟, ⚖️ 💽, ⚫️ 🔜 🔁 📨 1️⃣ 👫 👔 📟.
    
    !!! tip
    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)
  5. docs/en/docs/how-to/conditional-openapi.md

    <span style="color: green;">INFO</span>:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
    ```
    
    </div>
    
    Then if you go to the URLs at `/openapi.json`, `/docs`, or `/redoc` you will just get a `404 Not Found` error like:
    
    ```JSON
    {
        "detail": "Not Found"
    }
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  6. docs/em/docs/tutorial/handling-errors.md

    💰 🙋‍♀ ⚠ 🤭 `return`😅 💲 🔜 🌖 ⭐ 📄 🔃 🔗 &amp; 💂‍♂.
    
    👉 🖼, 🕐❔ 👩‍💻 📨 🏬 🆔 👈 🚫 🔀, 🤚 ⚠ ⏮️ 👔 📟 `404`:
    
    ```Python hl_lines="11"
    {!../../../docs_src/handling_errors/tutorial001.py!}
    ```
    
    ### 📉 📨
    
    🚥 👩‍💻 📨 `http://example.com/items/foo` ( `item_id` `"foo"`), 👈 👩‍💻 🔜 📨 🇺🇸🔍 👔 📟 2️⃣0️⃣0️⃣, &amp; 🎻 📨:
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.3K bytes
    - Viewed (0)
  7. docs/de/docs/tutorial/path-operation-configuration.md

    ## Response-Statuscode
    
    Sie können den (HTTP-)`status_code` definieren, den die Response Ihrer *Pfadoperation* verwenden soll.
    
    Sie können direkt den `int`-Code übergeben, etwa `404`.
    
    Aber falls Sie sich nicht mehr erinnern, wofür jede Nummer steht, können Sie die Abkürzungs-Konstanten in `status` verwenden:
    
    === "Python 3.10+"
    
        ```Python hl_lines="1  15"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:07:48 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  8. docs/ru/docs/tutorial/path-operation-configuration.md

    ## Коды состояния
    
    Вы можете определить (HTTP) `status_code`, который будет использован в ответах вашей *операции пути*.
    
    Вы можете передать только `int`-значение кода, например `404`.
    
    Но если вы не помните, для чего нужен каждый числовой код, вы можете использовать сокращенные константы в параметре `status`:
    
    === "Python 3.10+"
    
        ```Python hl_lines="1  15"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 8K bytes
    - Viewed (0)
  9. docs/de/docs/advanced/additional-responses.md

    **FastAPI** nimmt dieses Modell, generiert dessen JSON-Schema und fügt es an der richtigen Stelle in OpenAPI ein.
    
    Um beispielsweise eine weitere Response mit dem Statuscode `404` und einem Pydantic-Modell `Message` zu deklarieren, können Sie schreiben:
    
    ```Python hl_lines="18  22"
    {!../../../docs_src/additional_responses/tutorial001.py!}
    ```
    
    !!! note "Hinweis"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:19:26 GMT 2024
    - 9.6K bytes
    - Viewed (0)
  10. docs/en/docs/advanced/additional-responses.md

    **FastAPI** will take that model, generate its JSON Schema and include it in the correct place in OpenAPI.
    
    For example, to declare another response with a status code `404` and a Pydantic model `Message`, you can write:
    
    ```Python hl_lines="18  22"
    {!../../../docs_src/additional_responses/tutorial001.py!}
    ```
    
    !!! note
        Keep in mind that you have to return the `JSONResponse` directly.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 8.8K bytes
    - Viewed (0)
Back to top