Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 35 for 403 (0.16 sec)

  1. docs_src/bigger_applications/app/routers/items.py

    
    @router.put(
        "/{item_id}",
        tags=["custom"],
        responses={403: {"description": "Operation forbidden"}},
    )
    async def update_item(item_id: str):
        if item_id != "plumbus":
            raise HTTPException(
                status_code=403, detail="You can only update the item: plumbus"
            )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Nov 29 17:32:18 GMT 2020
    - 1011 bytes
    - Viewed (0)
  2. docs/en/docs/reference/status.md

    from fastapi import status
    ```
    
    `status` is provided directly by Starlette.
    
    It contains a group of named constants (variables) with integer status codes.
    
    For example:
    
    * 200: `status.HTTP_200_OK`
    * 403: `status.HTTP_403_FORBIDDEN`
    * etc.
    
    It can be convenient to quickly access HTTP (and WebSocket) status codes in your app, using autocompletion for the name without having to remember the integer status codes by memory.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 871 bytes
    - Viewed (0)
  3. docs/de/docs/reference/status.md

    ```
    
    `status` wird direkt von Starlette bereitgestellt.
    
    Es enthält eine Gruppe benannter Konstanten (Variablen) mit ganzzahligen Statuscodes.
    
    Zum Beispiel:
    
    * 200: `status.HTTP_200_OK`
    * 403: `status.HTTP_403_FORBIDDEN`
    * usw.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 18:17:17 GMT 2024
    - 934 bytes
    - Viewed (0)
  4. docs_src/bigger_applications/app_an_py39/routers/items.py

    
    @router.put(
        "/{item_id}",
        tags=["custom"],
        responses={403: {"description": "Operation forbidden"}},
    )
    async def update_item(item_id: str):
        if item_id != "plumbus":
            raise HTTPException(
                status_code=403, detail="You can only update the item: plumbus"
            )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 1011 bytes
    - Viewed (0)
  5. docs_src/bigger_applications/app_an/routers/items.py

    
    @router.put(
        "/{item_id}",
        tags=["custom"],
        responses={403: {"description": "Operation forbidden"}},
    )
    async def update_item(item_id: str):
        if item_id != "plumbus":
            raise HTTPException(
                status_code=403, detail="You can only update the item: plumbus"
            )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 1011 bytes
    - Viewed (0)
  6. tests/test_security_http_digest.py

        response = client.get("/users/me")
        assert response.status_code == 403, response.text
        assert response.json() == {"detail": "Not authenticated"}
    
    
    def test_security_http_digest_incorrect_scheme_credentials():
        response = client.get(
            "/users/me", headers={"Authorization": "Other invalidauthorization"}
        )
        assert response.status_code == 403, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2K bytes
    - Viewed (0)
  7. fastapi/security/open_id_connect_url.py

    from fastapi.openapi.models import OpenIdConnect as OpenIdConnectModel
    from fastapi.security.base import SecurityBase
    from starlette.exceptions import HTTPException
    from starlette.requests import Request
    from starlette.status import HTTP_403_FORBIDDEN
    from typing_extensions import Annotated, Doc
    
    
    class OpenIdConnect(SecurityBase):
        """
        OpenID Connect authentication class. An instance of it would be used as a
        dependency.
        """
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  8. tests/test_security_http_base_description.py

        assert response.json() == {"scheme": "Other", "credentials": "foobar"}
    
    
    def test_security_http_base_no_credentials():
        response = client.get("/users/me")
        assert response.status_code == 403, response.text
        assert response.json() == {"detail": "Not authenticated"}
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.9K bytes
    - Viewed (0)
  9. tests/test_security_api_key_cookie.py

        assert response.json() == {"username": "secret"}
    
    
    def test_security_api_key_no_key():
        client = TestClient(app)
        response = client.get("/users/me")
        assert response.status_code == 403, response.text
        assert response.json() == {"detail": "Not authenticated"}
    
    
    def test_openapi_schema():
        client = TestClient(app)
        response = client.get("/openapi.json")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.9K bytes
    - Viewed (0)
  10. tests/test_security_http_bearer.py

        response = client.get("/users/me")
        assert response.status_code == 403, response.text
        assert response.json() == {"detail": "Not authenticated"}
    
    
    def test_security_http_bearer_incorrect_scheme_credentials():
        response = client.get("/users/me", headers={"Authorization": "Basic notreally"})
        assert response.status_code == 403, response.text
        assert response.json() == {"detail": "Invalid authentication credentials"}
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2K bytes
    - Viewed (0)
Back to top