Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 131 - 140 of 1,014 for Resync (0.04 seconds)

  1. docs_src/dependency_testing/tutorial001_an_py39.py

    app = FastAPI()
    
    
    async def common_parameters(
        q: Union[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 {"message": "Hello Items!", "params": commons}
    
    
    @app.get("/users/")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 1.5K bytes
    - Click Count (0)
  2. docs_src/path_params/tutorial003b_py39.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/users")
    async def read_users():
        return ["Rick", "Morty"]
    
    
    @app.get("/users")
    async def read_users2():
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 193 bytes
    - Click Count (0)
  3. docs/en/docs/tutorial/dependencies/index.md

    ## To `async` or not to `async` { #to-async-or-not-to-async }
    
    As dependencies will also be called by **FastAPI** (the same as your *path operation functions*), the same rules apply while defining your functions.
    
    You can use `async def` or normal `def`.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sun Aug 31 09:15:41 GMT 2025
    - 9.6K bytes
    - Click Count (0)
  4. 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 Dec 28 07:19:09 GMT 2025
    - Last Modified: Mon Nov 24 19:03:06 GMT 2025
    - 2.4K bytes
    - Click Count (0)
  5. docs_src/async_tests/app_a_py39/test_main.py

    import pytest
    from httpx import ASGITransport, AsyncClient
    
    from .main import app
    
    
    @pytest.mark.anyio
    async def test_root():
        async with AsyncClient(
            transport=ASGITransport(app=app), base_url="http://test"
        ) as ac:
            response = await ac.get("/")
        assert response.status_code == 200
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 360 bytes
    - Click Count (0)
  6. docs_src/path_operation_configuration/tutorial006_py39.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/", tags=["items"])
    async def read_items():
        return [{"name": "Foo", "price": 42}]
    
    
    @app.get("/users/", tags=["users"])
    async def read_users():
        return [{"username": "johndoe"}]
    
    
    @app.get("/elements/", tags=["items"], deprecated=True)
    async def read_elements():
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 365 bytes
    - Click Count (0)
  7. docs_src/request_files/tutorial001_03_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, File, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(file: Annotated[bytes, File(description="A file read as bytes")]):
        return {"file_size": len(file)}
    
    
    @app.post("/uploadfile/")
    async def create_upload_file(
        file: Annotated[UploadFile, File(description="A file read as UploadFile")],
    ):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 421 bytes
    - Click Count (0)
  8. 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 Dec 28 07:19:09 GMT 2025
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 404 bytes
    - Click Count (0)
  9. tests/test_validation_error_context.py

    @app.exception_handler(RequestValidationError)
    @sub_app.exception_handler(RequestValidationError)
    async def request_validation_handler(request: Request, exc: RequestValidationError):
        captured_exception.capture(exc)
        raise exc
    
    
    @app.exception_handler(ResponseValidationError)
    @sub_app.exception_handler(ResponseValidationError)
    async def response_validation_handler(_: Request, exc: ResponseValidationError):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 06 12:21:57 GMT 2025
    - 4.7K bytes
    - Click Count (0)
  10. 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 Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 454 bytes
    - Click Count (0)
Back to Top