Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for HTTPException (0.27 sec)

  1. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

    **FastAPI** uses them internally to achieve this.
    
    ///
    
    ## Dependencies with `yield` and `HTTPException` { #dependencies-with-yield-and-httpexception }
    
    You saw that you can use dependencies with `yield` and have `try` blocks that catch exceptions.
    
    The same way, you could raise an `HTTPException` or similar in the exit code, after the `yield`.
    
    /// tip
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 12.7K 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.py hl[1] *}
    
    ### Raise an `HTTPException` in your code { #raise-an-httpexception-in-your-code }
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 9.4K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/security/oauth2-scopes.md

    The `security_scopes` object (of class `SecurityScopes`) also provides a `scope_str` attribute with a single string, containing those scopes separated by spaces (we are going to use it).
    
    We create an `HTTPException` that we can reuse (`raise`) later at several points.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 10:49:48 UTC 2025
    - 13.5K bytes
    - Viewed (0)
  4. docs/en/docs/advanced/security/http-basic-auth.md

    ### Return the error { #return-the-error }
    
    After detecting that the credentials are incorrect, return an `HTTPException` with a status code 401 (the same returned when no credentials are provided) and add the header `WWW-Authenticate` to make the browser show the login prompt again:
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 5K bytes
    - Viewed (0)
  5. docs/pt/docs/advanced/security/oauth2-scopes.md

    O objeto `security_scopes` (da classe `SecurityScopes`) também oferece um atributo `scope_str` com uma única string, contendo os escopos separados por espaços (nós vamos utilizar isso).
    
    Nós criamos uma `HTTPException` que nós podemos reutilizar (`raise`) mais tarde em diversos lugares.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 10:49:48 UTC 2025
    - 14.5K bytes
    - Viewed (0)
  6. docs/de/docs/advanced/security/oauth2-scopes.md

    Das `security_scopes`-Objekt (der Klasse `SecurityScopes`) stellt außerdem ein `scope_str`-Attribut mit einem einzelnen String bereit, der die durch Leerzeichen getrennten Scopes enthält (den werden wir verwenden).
    
    Wir erstellen eine `HTTPException`, die wir später an mehreren Stellen wiederverwenden (`raise`n) können.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 10:49:48 UTC 2025
    - 15.1K bytes
    - Viewed (0)
  7. docs/em/docs/advanced/security/oauth2-scopes.md

    ⚫️ 🔜 ✔️ 🏠 `scopes` ⏮️ 📇 ⚗ 🌐 ↔ ✔ ⚫️ & 🌐 🔗 👈 ⚙️ 👉 🎧-🔗. 👈 ⛓, 🌐 "⚓️"... 👉 💪 🔊 😨, ⚫️ 🔬 🔄 ⏪ 🔛.
    
    `security_scopes` 🎚 (🎓 `SecurityScopes`) 🚚 `scope_str` 🔢 ⏮️ 👁 🎻, 🔌 👈 ↔ 👽 🚀 (👥 🔜 ⚙️ ⚫️).
    
    👥 ✍ `HTTPException` 👈 👥 💪 🏤-⚙️ (`raise`) ⏪ 📚 ☝.
    
    👉 ⚠, 👥 🔌 ↔ 🚚 (🚥 🙆) 🎻 👽 🚀 (⚙️ `scope_str`). 👥 🚮 👈 🎻 ⚗ ↔ `WWW-Authenticate` 🎚 (👉 🍕 🔌).
    
    {* ../../docs_src/security/tutorial005.py hl[105,107:115] *}
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 10:03:10 UTC 2025
    - 10.8K bytes
    - Viewed (0)
  8. docs/es/docs/advanced/security/oauth2-scopes.md

    El objeto `security_scopes` (de la clase `SecurityScopes`) también proporciona un atributo `scope_str` con un único string, que contiene esos scopes separados por espacios (lo vamos a usar).
    
    Creamos una `HTTPException` que podemos reutilizar (`raise`) más tarde en varios puntos.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 10:49:48 UTC 2025
    - 13.8K bytes
    - Viewed (0)
  9. 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 Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 9.4K bytes
    - Viewed (0)
  10. docs/en/docs/advanced/websockets.md

    {* ../../docs_src/websockets/tutorial002_an_py310.py hl[68:69,82] *}
    
    /// info
    
    As this is a WebSocket it doesn't really make sense to raise an `HTTPException`, instead we raise a `WebSocketException`.
    
    You can use a closing code from the <a href="https://tools.ietf.org/html/rfc6455#section-7.4.1" class="external-link" target="_blank">valid codes defined in the specification</a>.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 5.7K bytes
    - Viewed (0)
Back to top