- Sort Score
- Num 10 results
- Language All
Results 71 - 80 of 139 for HTTPException (0.07 seconds)
-
docs/ja/docs/advanced/security/http-basic-auth.md
このように、アプリケーションコードで `secrets.compare_digest()` を使うと、この種の一連のセキュリティ攻撃に対して安全になります。 ### エラーを返す { #return-the-error } 認証情報が不正であることを検出したら、ステータスコード 401(認証情報が提供されない場合と同じ)で `HTTPException` を返し、ブラウザに再度ログインプロンプトを表示させるためにヘッダー `WWW-Authenticate` を追加します:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:07:17 GMT 2026 - 6.4K bytes - Click Count (0) -
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.
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 9.4K bytes - Click Count (0) -
docs/zh/docs/tutorial/security/simple-oauth2.md
本例没有使用 `scopes`,但开发者也可以根据需要使用该属性。 /// 现在,即可使用表单字段 `username`,从(伪)数据库中获取用户数据。 如果不存在指定用户,则返回错误消息,提示**用户名或密码错误**。 本例使用 `HTTPException` 异常显示此错误: {* ../../docs_src/security/tutorial003_an_py310.py hl[3,79:81] *} ### 校验密码 { #check-the-password } 至此,我们已经从数据库中获取了用户数据,但尚未校验密码。 接下来,首先将数据放入 Pydantic 的 `UserInDB` 模型。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 9K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/security/simple-oauth2.md
本示例沒有使用 `scopes`,但如果你需要,功能已經在那裡了。 /// 現在,從(假的)資料庫裡用表單欄位的 `username` 取得使用者資料。 如果沒有該使用者,就回傳「Incorrect username or password」的錯誤。 我們用 `HTTPException` 這個例外來回傳錯誤: {* ../../docs_src/security/tutorial003_an_py310.py hl[3,79:81] *} ### 檢查密碼 { #check-the-password } 這時我們已經有來自資料庫的使用者資料,但還沒檢查密碼。 先把那些資料放進 Pydantic 的 `UserInDB` 模型。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 9.1K bytes - Click Count (0) -
docs/ja/docs/tutorial/security/simple-oauth2.md
この例では `scopes` は使いませんが、必要ならその機能が利用できます。 /// 次に、フォームフィールドの `username` を使って(疑似の)データベースからユーザーデータを取得します。 そのユーザーが存在しない場合は、「Incorrect username or password」というエラーを返します。 エラーには `HTTPException` 例外を使います: {* ../../docs_src/security/tutorial003_an_py310.py hl[3,79:81] *} ### パスワードのチェック { #check-the-password } この時点でデータベースからユーザーデータは取得できましたが、まだパスワードを確認していません。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:07:17 GMT 2026 - 12.1K bytes - Click Count (0) -
docs/pt/docs/tutorial/handling-errors.md
## Use o `HTTPException` { #use-httpexception } Para retornar ao cliente *responses* HTTP com erros, use o `HTTPException`. ### Import `HTTPException` { #import-httpexception } {* ../../docs_src/handling_errors/tutorial001_py310.py hl[1] *} ### Lance o `HTTPException` no seu código { #raise-an-httpexception-in-your-code }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:20:43 GMT 2026 - 10.1K bytes - Click Count (0) -
docs/es/docs/tutorial/handling-errors.md
## Usa `HTTPException` { #use-httpexception } Para devolver responses HTTP con errores al cliente, usa `HTTPException`. ### Importa `HTTPException` { #import-httpexception } {* ../../docs_src/handling_errors/tutorial001_py310.py hl[1] *} ### Lanza un `HTTPException` en tu código { #raise-an-httpexception-in-your-code }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:15:55 GMT 2026 - 9.6K bytes - Click Count (0) -
docs/uk/docs/tutorial/handling-errors.md
## Використання `HTTPException` { #use-httpexception } Щоб повернути HTTP-відповіді з помилками клієнту, використовуйте `HTTPException`. ### Імпорт `HTTPException` { #import-httpexception } {* ../../docs_src/handling_errors/tutorial001_py310.py hl[1] *} ### Згенеруйте `HTTPException` у своєму коді { #raise-an-httpexception-in-your-code }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:27:41 GMT 2026 - 13.9K bytes - Click Count (0) -
docs/tr/docs/tutorial/handling-errors.md
"size": "XL" } } ``` #### FastAPI’nin `HTTPException`’ı vs Starlette’in `HTTPException`’ı { #fastapis-httpexception-vs-starlettes-httpexception } **FastAPI**’nin kendi `HTTPException`’ı vardır. Ve **FastAPI**’nin `HTTPException` hata sınıfı, Starlette’in `HTTPException` hata sınıfından kalıtım alır (inherit).
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 07:53:17 GMT 2026 - 9.7K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/handling-errors.md
"size": "XL" } } ``` #### FastAPI 的 `HTTPException` 與 Starlette 的 `HTTPException` { #fastapis-httpexception-vs-starlettes-httpexception } **FastAPI** 有自己定義的 `HTTPException`。 而 **FastAPI** 的 `HTTPException` 錯誤類別是繼承自 Starlette 的 `HTTPException` 錯誤類別。 唯一的差異是,**FastAPI** 的 `HTTPException` 在 `detail` 欄位接受任何可轉為 JSON 的資料,而 Starlette 的 `HTTPException` 只接受字串。 因此,在你的程式碼中,你可以一如往常地 raise **FastAPI** 的 `HTTPException`。
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 8.3K bytes - Click Count (0)