Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 51 - 60 of 828 for Async (0.37 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. docs_src/dependencies/tutorial001_py310.py

    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    async def common_parameters(q: str | None = None, skip: int = 0, limit: int = 100):
        return {"q": q, "skip": skip, "limit": limit}
    
    
    @app.get("/items/")
    async def read_items(commons: dict = Depends(common_parameters)):
        return commons
    
    
    @app.get("/users/")
    async def read_users(commons: dict = Depends(common_parameters)):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 404 bytes
    - Click Count (0)
  2. docs_src/security/tutorial003_py310.py

        return user
    
    
    async def get_current_user(token: str = Depends(oauth2_scheme)):
        user = fake_decode_token(token)
        if not user:
            raise HTTPException(
                status_code=status.HTTP_401_UNAUTHORIZED,
                detail="Not authenticated",
                headers={"WWW-Authenticate": "Bearer"},
            )
        return user
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Nov 24 19:03:06 GMT 2025
    - 2.4K bytes
    - Click Count (0)
  3. src/main/java/jcifs/internal/witness/WitnessClient.java

                    } catch (InterruptedException e) {
                        log.debug("Async notification monitoring interrupted for {}", registrationId);
                        Thread.currentThread().interrupt();
                        break;
                    } catch (Exception e) {
                        log.debug("Error in async notification monitoring for {}: {}", registrationId, e.getMessage());
    
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 30 05:58:03 GMT 2025
    - 20.8K bytes
    - Click Count (0)
  4. docs_src/dependencies/tutorial001_an_py310.py

    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    async def common_parameters(q: str | None = None, skip: int = 0, limit: int = 100):
        return {"q": q, "skip": skip, "limit": limit}
    
    
    @app.get("/items/")
    async def read_items(commons: Annotated[dict, Depends(common_parameters)]):
        return commons
    
    
    @app.get("/users/")
    async def read_users(commons: Annotated[dict, Depends(common_parameters)]):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 454 bytes
    - Click Count (0)
  5. docs_src/dependencies/tutorial006_py310.py

    from fastapi import Depends, FastAPI, Header, HTTPException
    
    app = FastAPI()
    
    
    async def verify_token(x_token: str = Header()):
        if x_token != "fake-super-secret-token":
            raise HTTPException(status_code=400, detail="X-Token header invalid")
    
    
    async def verify_key(x_key: str = Header()):
        if x_key != "fake-super-secret-key":
            raise HTTPException(status_code=400, detail="X-Key header invalid")
        return x_key
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 583 bytes
    - Click Count (0)
  6. tests/test_strict_content_type_nested.py

    inner_strict = APIRouter(prefix="/strict", strict_content_type=True)
    inner_default = APIRouter(prefix="/default")
    
    
    @inner_strict.post("/items/")
    async def inner_strict_post(data: dict):
        return data
    
    
    @inner_default.post("/items/")
    async def inner_default_post(data: dict):
        return data
    
    
    outer_router.include_router(inner_strict)
    outer_router.include_router(inner_default)
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Feb 23 17:45:20 GMT 2026
    - 2.7K bytes
    - Click Count (0)
  7. tests/test_http_connection_injection.py

    from starlette.websockets import WebSocket
    
    app = FastAPI()
    app.state.value = 42
    
    
    async def extract_value_from_http_connection(conn: HTTPConnection):
        return conn.app.state.value
    
    
    @app.get("/http")
    async def get_value_by_http(value: int = Depends(extract_value_from_http_connection)):
        return value
    
    
    @app.websocket("/ws")
    async def get_value_by_ws(
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Aug 09 13:56:41 GMT 2020
    - 972 bytes
    - Click Count (0)
  8. docs_src/bigger_applications/app_an_py310/routers/items.py

        responses={404: {"description": "Not found"}},
    )
    
    
    fake_items_db = {"plumbus": {"name": "Plumbus"}, "gun": {"name": "Portal Gun"}}
    
    
    @router.get("/")
    async def read_items():
        return fake_items_db
    
    
    @router.get("/{item_id}")
    async def read_item(item_id: str):
        if item_id not in fake_items_db:
            raise HTTPException(status_code=404, detail="Item not found")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 1011 bytes
    - Click Count (0)
  9. docs_src/custom_request_and_route/tutorial003_py310.py

                return response
    
            return custom_route_handler
    
    
    app = FastAPI()
    router = APIRouter(route_class=TimedRoute)
    
    
    @app.get("/")
    async def not_timed():
        return {"message": "Not timed"}
    
    
    @router.get("/timed")
    async def timed():
        return {"message": "It's the time of my life"}
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 10 08:55:32 GMT 2025
    - 1K bytes
    - Click Count (0)
  10. tests/test_annotated.py

    from inline_snapshot import snapshot
    
    app = FastAPI()
    
    
    @app.get("/default")
    async def default(foo: Annotated[str, Query()] = "foo"):
        return {"foo": foo}
    
    
    @app.get("/required")
    async def required(foo: Annotated[str, Query(min_length=1)]):
        return {"foo": foo}
    
    
    @app.get("/multiple")
    async def multiple(foo: Annotated[str, object(), Query(min_length=1)]):
        return {"foo": foo}
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:18:38 GMT 2026
    - 10.5K bytes
    - Click Count (0)
Back to Top