Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 462 for Portal (0.26 sec)

  1. docs_src/response_model/tutorial003_05_py310.py

    from fastapi.responses import RedirectResponse
    
    app = FastAPI()
    
    
    @app.get("/portal", response_model=None)
    async def get_portal(teleport: bool = False) -> Response | dict:
        if teleport:
            return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Jan 10 16:22:47 UTC 2023
    - 373 bytes
    - Viewed (0)
  2. docs_src/response_model/tutorial003_02_py39.py

    from fastapi.responses import JSONResponse, RedirectResponse
    
    app = FastAPI()
    
    
    @app.get("/portal")
    async def get_portal(teleport: bool = False) -> Response:
        if teleport:
            return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 381 bytes
    - Viewed (0)
  3. docs_src/dependencies/tutorial008d_py39.py

            raise
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: str = Depends(get_username)):
        if item_id == "portal-gun":
            raise InternalError(
                f"The portal gun is too dangerous to be owned by {username}"
            )
        if item_id != "plumbus":
            raise HTTPException(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 694 bytes
    - Viewed (0)
  4. docs_src/dependencies/tutorial008d_an_py39.py

            raise
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
            raise InternalError(
                f"The portal gun is too dangerous to be owned by {username}"
            )
        if item_id != "plumbus":
            raise HTTPException(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Feb 24 23:06:37 UTC 2024
    - 734 bytes
    - Viewed (0)
  5. tests/test_tutorial/test_dependencies/test_tutorial008c.py

        with pytest.raises(FastAPIError) as exc_info:
            client.get("/items/portal-gun")
        assert "raising an exception and a dependency with yield" in exc_info.value.args[0]
    
    
    def test_internal_server_error(mod: ModuleType):
        client = TestClient(mod.app, raise_server_exceptions=False)
        response = client.get("/items/portal-gun")
        assert response.status_code == 500, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.4K bytes
    - Viewed (0)
  6. docs_src/behind_a_proxy/tutorial001_01_py39.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/")
    def read_items():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 122 bytes
    - Viewed (0)
  7. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial005.py

                            }
                        },
                        "summary": "Read Items",
                        "operationId": "read_items_items__get",
                        "x-aperture-labs-portal": "blue",
                    }
                }
            },
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1K bytes
    - Viewed (0)
  8. docs_src/response_model/tutorial001_py39.py

    @app.post("/items/", response_model=Item)
    async def create_item(item: Item) -> Any:
        return item
    
    
    @app.get("/items/", response_model=list[Item])
    async def read_items() -> Any:
        return [
            {"name": "Portal Gun", "price": 42.0},
            {"name": "Plumbus", "price": 32.0},
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Jan 07 13:45:48 UTC 2023
    - 556 bytes
    - Viewed (0)
  9. docs_src/response_model/tutorial001_01_py310.py

        tags: list[str] = []
    
    
    @app.post("/items/")
    async def create_item(item: Item) -> Item:
        return item
    
    
    @app.get("/items/")
    async def read_items() -> list[Item]:
        return [
            Item(name="Portal Gun", price=42.0),
            Item(name="Plumbus", price=32.0),
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Jan 07 13:45:48 UTC 2023
    - 469 bytes
    - Viewed (0)
  10. docs_src/dependencies/tutorial012_py39.py

        return x_key
    
    
    app = FastAPI(dependencies=[Depends(verify_token), Depends(verify_key)])
    
    
    @app.get("/items/")
    async def read_items():
        return [{"item": "Portal Gun"}, {"item": "Plumbus"}]
    
    
    @app.get("/users/")
    async def read_users():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 696 bytes
    - Viewed (0)
Back to top