Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 67 for Prijck (0.16 sec)

  1. tests/test_tutorial/test_dependencies/test_tutorial008b.py

        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "Owner error: Rick"}
    
    
    def test_get_item():
        response = client.get("/items/portal-gun")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Dec 26 20:37:34 GMT 2023
    - 697 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py

        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "Owner error: Rick"}
    
    
    @needs_py39
    def test_get_item(client: TestClient):
        response = client.get("/items/portal-gun")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 918 bytes
    - Viewed (0)
  3. docs_src/openapi_webhooks/tutorial001.py

        data to the URL that you register for the event `new-subscription` in the dashboard.
        """
    
    
    @app.get("/users/")
    def read_users():
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Oct 20 09:00:44 GMT 2023
    - 550 bytes
    - Viewed (0)
  4. docs_src/dependencies/tutorial008d.py

    from fastapi import Depends, FastAPI, HTTPException
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("We don't swallow the internal error here, we raise again 😎")
            raise
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: str = Depends(get_username)):
        if item_id == "portal-gun":
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 694 bytes
    - Viewed (0)
  5. docs_src/dependencies/tutorial008d_an.py

    from fastapi import Depends, FastAPI, HTTPException
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("We don't swallow the internal error here, we raise again 😎")
            raise
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 744 bytes
    - Viewed (0)
  6. docs_src/dependencies/tutorial008d_an_py39.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI, HTTPException
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("We don't swallow the internal error here, we raise again 😎")
            raise
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 734 bytes
    - Viewed (0)
  7. tests/test_tutorial/test_separate_openapi_schemas/test_tutorial001_py39.py

        assert response.status_code == 200, response.text
        assert response.json() == [
            {
                "name": "Portal Gun",
                "description": "Device to travel through the multi-rick-verse",
            },
            {"name": "Plumbus", "description": None},
        ]
    
    
    @needs_py39
    @needs_pydanticv2
    def test_openapi_schema(client: TestClient) -> None:
        response = client.get("/openapi.json")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  8. docs/de/docs/advanced/settings.md

        end
    
        rect rgba(0, 255, 0, .1)
            code ->> function: say_hi(name="Rick")
            function ->> execute: führe Code der Funktion aus
            execute ->> code: gib das Resultat zurück
        end
    
        rect rgba(0, 255, 0, .1)
            code ->> function: say_hi(name="Rick", salutation="Mr.")
            function ->> execute: führe Code der Funktion aus
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:17:14 GMT 2024
    - 17.8K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/query-params-str-validations.md

    ```Python
    q: Annotated[str, Query(default="rick")] = "morty"
    ```
    
    ...because it's not clear if the default value should be `"rick"` or `"morty"`.
    
    So, you would use (preferably):
    
    ```Python
    q: Annotated[str, Query()] = "rick"
    ```
    
    ...or in older code bases you will find:
    
    ```Python
    q: str = Query(default="rick")
    ```
    
    ### Advantages of `Annotated`
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 25.7K bytes
    - Viewed (0)
  10. docs/en/docs/tutorial/dependencies/index.md

    !!! tip
        This is just standard Python, it's called a "type alias", it's actually not specific to **FastAPI**.
    
        But because **FastAPI** is based on the Python standards, including `Annotated`, you can use this trick in your code. 😎
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.6K bytes
    - Viewed (0)
Back to top