Search Options

Results per page
Sort
Preferred Languages
Advance

Results 111 - 120 of 120 for HTTPException (0.07 sec)

  1. docs/en/docs/tutorial/security/simple-oauth2.md

    Now, get the user data from the (fake) database, using the `username` from the form field.
    
    If there is no such user, we return an error saying "Incorrect username or password".
    
    For the error, we use the exception `HTTPException`:
    
    {* ../../docs_src/security/tutorial003_an_py310.py hl[3,79:81] *}
    
    ### Check the password { #check-the-password }
    
    At this point we have the user data from our database, but we haven't checked the password.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 9.4K bytes
    - Viewed (0)
  2. docs/es/docs/tutorial/security/simple-oauth2.md

    Si no existe tal usuario, devolvemos un error diciendo "Incorrect username or password".
    
    Para el error, usamos la excepción `HTTPException`:
    
    {* ../../docs_src/security/tutorial003_an_py310.py hl[3,79:81] *}
    
    ### Revisa el password { #check-the-password }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 16:33:45 UTC 2025
    - 10.3K bytes
    - Viewed (0)
  3. docs/ja/docs/advanced/websockets.md

    * `Header`
    * `Path`
    * `Query`
    
    これらは、他のFastAPI エンドポイント/*path operation* の場合と同じように機能します。
    
    {* ../../docs_src/websockets/tutorial002.py hl[58:65,68:83] *}
    
    /// info | 情報
    
    WebSocket で `HTTPException` を発生させることはあまり意味がありません。したがって、WebSocketの接続を直接閉じる方がよいでしょう。
    
    クロージングコードは、<a href="https://tools.ietf.org/html/rfc6455#section-7.4.1" class="external-link" target="_blank">仕様で定義された有効なコード</a>の中から使用することができます。
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  4. docs/ru/docs/tutorial/security/simple-oauth2.md

    Если такого пользователя нет, то мы возвращаем ошибку "Incorrect username or password" (неверное имя пользователя или пароль).
    
    Для ошибки используем исключение `HTTPException`:
    
    {* ../../docs_src/security/tutorial003_an_py310.py hl[3,79:81] *}
    
    ### Проверка пароля { #check-the-password }
    
    На данный момент у нас есть данные о пользователе из нашей базы данных, но мы еще не проверили пароль.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Sep 30 11:24:39 UTC 2025
    - 16.3K bytes
    - Viewed (0)
  5. docs/pt/docs/tutorial/security/simple-oauth2.md

    Agora, obtenha os dados do usuário do banco de dados (falso), usando o `username` do campo do formulário.
    
    Se não existir tal usuário, retornaremos um erro dizendo "Incorrect username or password".
    
    Para o erro, usamos a exceção `HTTPException`:
    
    {* ../../docs_src/security/tutorial003_an_py310.py hl[3,79:81] *}
    
    ### Confira a senha { #check-the-password }
    
    Neste ponto temos os dados do usuário do nosso banco de dados, mas não verificamos a senha.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Nov 12 16:23:57 UTC 2025
    - 10.3K bytes
    - Viewed (0)
  6. docs/zh/docs/tutorial/security/simple-oauth2.md

    本例没有使用 `scopes`,但开发者也可以根据需要使用该属性。
    
    ///
    
    现在,即可使用表单字段 `username`,从(伪)数据库中获取用户数据。
    
    如果不存在指定用户,则返回错误消息,提示**用户名或密码错误**。
    
    本例使用 `HTTPException` 异常显示此错误:
    
    {* ../../docs_src/security/tutorial003.py hl[3,77:79] *}
    
    ### 校验密码
    
    至此,我们已经从数据库中获取了用户数据,但尚未校验密码。
    
    接下来,首先将数据放入 Pydantic 的 `UserInDB` 模型。
    
    注意:永远不要保存明文密码,本例暂时先使用(伪)哈希密码系统。
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 8.6K bytes
    - Viewed (0)
  7. docs/ko/docs/tutorial/security/simple-oauth2.md

    이 예제에서는 `scopes`를 사용하지 않지만 필요한 경우, 기능이 있습니다.
    
    ///
    
    이제 폼 필드의 `username`을 사용하여 (가짜) 데이터베이스에서 유저 데이터를 가져옵니다.
    
    해당 사용자가 없으면 "잘못된 사용자 이름 또는 패스워드"라는 오류가 반환됩니다.
    
    오류의 경우 `HTTPException` 예외를 사용합니다:
    
    {* ../../docs_src/security/tutorial003.py hl[3,77:79] *}
    
    ### 패스워드 확인하기
    
    이 시점에서 데이터베이스의 사용자 데이터 형식을 확인했지만 암호를 확인하지 않았습니다.
    
    먼저 데이터를 Pydantic `UserInDB` 모델에 넣겠습니다.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Feb 15 11:19:12 UTC 2025
    - 10.8K bytes
    - Viewed (0)
  8. fastapi/routing.py

                    endpoint_ctx=endpoint_ctx,
                )
                raise validation_error from e
            except HTTPException:
                # If a middleware raises an HTTPException, it should be raised again
                raise
            except Exception as e:
                http_error = HTTPException(
                    status_code=400, detail="There was an error parsing the body"
                )
                raise http_error from e
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 174.6K bytes
    - Viewed (0)
  9. docs/en/docs/release-notes.md

    ### Dependencies with `yield`, `HTTPException` and Background Tasks
    
    Dependencies with `yield` now can raise `HTTPException` and other exceptions after `yield`. 🎉
    
    Read the new docs here: [Dependencies with `yield` and `HTTPException`](https://fastapi.tiangolo.com/tutorial/dependencies/dependencies-with-yield/#dependencies-with-yield-and-httpexception).
    
    ```Python
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 19:06:15 UTC 2025
    - 586.7K bytes
    - Viewed (0)
  10. fastapi/applications.py

    from fastapi.types import DecoratedCallable, IncEx
    from fastapi.utils import generate_unique_id
    from starlette.applications import Starlette
    from starlette.datastructures import State
    from starlette.exceptions import HTTPException
    from starlette.middleware import Middleware
    from starlette.middleware.base import BaseHTTPMiddleware
    from starlette.middleware.errors import ServerErrorMiddleware
    from starlette.middleware.exceptions import ExceptionMiddleware
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 176.3K bytes
    - Viewed (0)
Back to top