Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 120 for HTTPException (0.77 sec)

  1. 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_py39.py hl[1] *}
    
    ### Lance o `HTTPException` no seu código { #raise-an-httpexception-in-your-code }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 10.2K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/handling-errors.md

    ## Use `HTTPException` { #use-httpexception }
    
    To return HTTP responses with errors to the client you use `HTTPException`.
    
    ### Import `HTTPException` { #import-httpexception }
    
    {* ../../docs_src/handling_errors/tutorial001_py39.py hl[1] *}
    
    ### Raise an `HTTPException` in your code { #raise-an-httpexception-in-your-code }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 9K bytes
    - Viewed (0)
  3. 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_py39.py hl[1] *}
    
    ### Lanza un `HTTPException` en tu código { #raise-an-httpexception-in-your-code }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 9.7K bytes
    - Viewed (0)
  4. docs/uk/docs/tutorial/handling-errors.md

      }
    }
    ```
    
    #### `HTTPException` FastAPI проти `HTTPException` Starlette
    
    **FastAPI** має власний `HTTPException`.
    
    І клас помилки `HTTPException` в **FastAPI** успадковується від класу помилки `HTTPException` в Starlette.
    
    Єдина різниця полягає в тому, що `HTTPException` в **FastAPI** приймає будь-які дані, які можна перетворити на JSON, для поля `detail`, тоді як `HTTPException` у Starlette приймає тільки рядки.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 13.9K bytes
    - Viewed (0)
  5. docs_src/app_testing/app_b_an_py310/main.py

    @app.get("/items/{item_id}", response_model=Item)
    async def read_main(item_id: str, x_token: Annotated[str, Header()]):
        if x_token != fake_secret_token:
            raise HTTPException(status_code=400, detail="Invalid X-Token header")
        if item_id not in fake_db:
            raise HTTPException(status_code=404, detail="Item not found")
        return fake_db[item_id]
    
    
    @app.post("/items/", response_model=Item)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Thu Aug 15 22:31:16 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  6. docs_src/security/tutorial003_an_py39.py

        if not user:
            raise HTTPException(
                status_code=status.HTTP_401_UNAUTHORIZED,
                detail="Not authenticated",
                headers={"WWW-Authenticate": "Bearer"},
            )
        return user
    
    
    async def get_current_active_user(
        current_user: Annotated[User, Depends(get_current_user)],
    ):
        if current_user.disabled:
            raise HTTPException(status_code=400, detail="Inactive user")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 24 19:03:06 UTC 2025
    - 2.5K bytes
    - Viewed (0)
  7. docs/ru/docs/tutorial/handling-errors.md

    ## Использование `HTTPException` { #use-httpexception }
    
    Для возврата клиенту HTTP-ответов с ошибками используется `HTTPException`.
    
    ### Импортируйте `HTTPException` { #import-httpexception }
    
    {* ../../docs_src/handling_errors/tutorial001_py39.py hl[1] *}
    
    ### Вызовите `HTTPException` в своем коде { #raise-an-httpexception-in-your-code }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 14.1K bytes
    - Viewed (0)
  8. docs/ja/docs/tutorial/handling-errors.md

      }
    }
    ```
    
    #### FastAPIの`HTTPException`とStarletteの`HTTPException`
    
    **FastAPI**は独自の`HTTPException`を持っています。
    
    また、 **FastAPI**のエラークラス`HTTPException`はStarletteのエラークラス`HTTPException`を継承しています。
    
    唯一の違いは、**FastAPI** の`HTTPException`はレスポンスに含まれるヘッダを追加できることです。
    
    これはOAuth 2.0といくつかのセキュリティユーティリティのために内部的に必要とされ、使用されています。
    
    そのため、コード内では通常通り **FastAPI** の`HTTPException`を発生させ続けることができます。
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 11.6K bytes
    - Viewed (0)
  9. docs/de/docs/tutorial/handling-errors.md

        "size": "XL"
      }
    }
    ```
    
    #### FastAPIs `HTTPException` vs. Starlettes `HTTPException` { #fastapis-httpexception-vs-starlettes-httpexception }
    
    **FastAPI** hat seine eigene `HTTPException`.
    
    Und die `HTTPException`-Fehlerklasse von **FastAPI** erbt von der `HTTPException`-Fehlerklasse von Starlette.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 10.4K bytes
    - Viewed (0)
  10. docs_src/authentication_error_status_code/tutorial001_an_py39.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI, HTTPException, status
    from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
    
    app = FastAPI()
    
    
    class HTTPBearer403(HTTPBearer):
        def make_not_authenticated_error(self) -> HTTPException:
            return HTTPException(
                status_code=status.HTTP_403_FORBIDDEN, detail="Not authenticated"
            )
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 24 19:03:06 UTC 2025
    - 618 bytes
    - Viewed (0)
Back to top