Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 231 - 240 of 1,131 for defs (0.06 seconds)

  1. tests/test_security_http_base_description.py

    app = FastAPI()
    
    security = HTTPBase(scheme="Other", description="Other Security Scheme")
    
    
    @app.get("/users/me")
    def read_current_user(credentials: HTTPAuthorizationCredentials = Security(security)):
        return {"scheme": credentials.scheme, "credentials": credentials.credentials}
    
    
    client = TestClient(app)
    
    
    def test_security_http_base():
        response = client.get("/users/me", headers={"Authorization": "Other foobar"})
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:18:38 GMT 2026
    - 2.1K bytes
    - Click Count (0)
  2. docs/pt/docs/async.md

    ```Python hl_lines="1"
    async def get_burgers(number: int):
        # Faz alguma coisa assíncrona para criar os hambúrgueres
        return burgers
    ```
    
    ...ao invés de `def`:
    
    ```Python hl_lines="2"
    # Isso não é assíncrono
    def get_sequential_burgers(number: int):
        # Faz alguma coisa sequencial para criar os hambúrgueres
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:43 GMT 2026
    - 25.2K bytes
    - Click Count (0)
  3. tests/test_dependency_after_yield_websockets.py

    
    class Session:
        def __init__(self) -> None:
            self.data = ["foo", "bar", "baz"]
            self.open = True
    
        def __iter__(self) -> Generator[str, None, None]:
            for item in self.data:
                if self.open:
                    yield item
                else:
                    raise ValueError("Session closed")
    
    
    @contextmanager
    def acquire_session() -> Generator[Session, None, None]:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 2K bytes
    - Click Count (0)
  4. docs/fr/docs/advanced/middleware.md

    # Utiliser des middlewares avancés { #advanced-middleware }
    
    Dans le tutoriel principal, vous avez vu comment ajouter des [middlewares personnalisés](../tutorial/middleware.md) à votre application.
    
    Vous avez également vu comment gérer [CORS avec le `CORSMiddleware`](../tutorial/cors.md).
    
    Dans cette section, nous allons voir comment utiliser d'autres middlewares.
    
    ## Ajouter des middlewares ASGI { #adding-asgi-middlewares }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:37:13 GMT 2026
    - 4.7K bytes
    - Click Count (0)
  5. tests/test_tutorial/test_body/test_tutorial002.py

        params=[
            pytest.param("tutorial002_py310", marks=needs_py310),
        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.body.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    @pytest.mark.parametrize("price", ["50.5", 50.5])
    def test_post_with_tax(client: TestClient, price: str | float):
        response = client.post(
            "/items/",
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 5.8K bytes
    - Click Count (0)
  6. tests/test_tutorial/test_body_nested_models/test_tutorial008.py

    
    @pytest.fixture(
        name="client",
        params=[
            pytest.param("tutorial008_py310"),
        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.body_nested_models.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    def test_post_body(client: TestClient):
        data = [
            {"url": "http://example.com/", "name": "Example"},
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 6K bytes
    - Click Count (0)
  7. build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy

        def compatibleVersion = Version.fromString(VersionProperties.getVersions().get("elasticsearch")).getMajor() - 1
        def specIntermediateDir = "restResources/v${compatibleVersion}/yamlSpecs"
        def testIntermediateDir = "restResources/v${compatibleVersion}/yamlTests"
        def transformTask  = ":yamlRestTestV${compatibleVersion}CompatTransform"
        def YAML_FACTORY = new YAMLFactory()
    Created: Wed Apr 08 16:19:15 GMT 2026
    - Last Modified: Thu Sep 30 16:30:48 GMT 2021
    - 16.4K bytes
    - Click Count (0)
  8. tests/test_tutorial/test_body/test_tutorial001.py

    @pytest.fixture(
        name="client",
        params=[
            pytest.param("tutorial001_py310", marks=needs_py310),
        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.body.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    def test_body_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": 50.5})
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Feb 23 17:45:20 GMT 2026
    - 11.1K bytes
    - Click Count (0)
  9. docs/fr/docs/advanced/security/oauth2-scopes.md

    La spécification OAuth2 définit des « scopes » comme une liste de chaînes séparées par des espaces.
    
    Le contenu de chacune de ces chaînes peut avoir n’importe quel format, mais ne doit pas contenir d’espaces.
    
    Ces scopes représentent des « permissions ».
    
    Dans OpenAPI (par ex. la documentation de l’API), vous pouvez définir des « schémas de sécurité ».
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:37:13 GMT 2026
    - 15.5K bytes
    - Click Count (0)
  10. tests/test_security_api_key_cookie_optional.py

    api_key = APIKeyCookie(name="key", auto_error=False)
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: str | None = Security(api_key)):
        if oauth_header is None:
            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    def read_current_user(current_user: User = Depends(get_current_user)):
        if current_user is None:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 2.2K bytes
    - Click Count (0)
Back to Top