Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 841 - 850 of 1,096 for sltr (0.02 seconds)

  1. tests/embedded_struct_test.go

    }
    
    func (c *Content) Scan(src interface{}) error {
    	var value Content
    	str, ok := src.(string)
    	if !ok {
    		byt, ok := src.([]byte)
    		if !ok {
    			return errors.New("Embedded.Scan byte assertion failed")
    		}
    		if err := json.Unmarshal(byt, &value); err != nil {
    			return err
    		}
    	} else {
    		if err := json.Unmarshal([]byte(str), &value); err != nil {
    			return err
    		}
    	}
    
    	*c = value
    
    Created: Sun Apr 05 09:35:12 GMT 2026
    - Last Modified: Wed May 08 04:07:58 GMT 2024
    - 7.3K bytes
    - Click Count (0)
  2. tests/test_security_oauth2_authorization_code_bearer_description.py

    oauth2_scheme = OAuth2AuthorizationCodeBearer(
        authorizationUrl="authorize",
        tokenUrl="token",
        description="OAuth2 Code Bearer",
        auto_error=True,
    )
    
    
    @app.get("/items/")
    async def read_items(token: str | None = Security(oauth2_scheme)):
        return {"token": token}
    
    
    client = TestClient(app)
    
    
    def test_no_token():
        response = client.get("/items")
        assert response.status_code == 401, response.text
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 2.5K bytes
    - Click Count (0)
  3. tests/test_security_oauth2_password_bearer_optional.py

    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    app = FastAPI()
    
    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/token", auto_error=False)
    
    
    @app.get("/items/")
    async def read_items(token: str | None = Security(oauth2_scheme)):
        if token is None:
            return {"msg": "Create an account first"}
        return {"token": token}
    
    
    client = TestClient(app)
    
    
    def test_no_token():
    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)
  4. docs/uk/docs/tutorial/path-params-numeric-validations.md

    /// tip | Порада
    
    Це, мабуть, не настільки важливо або необхідно, якщо ви використовуєте `Annotated`.
    
    ///
    
    Припустимо, ви хочете оголосити параметр запиту `q` як обов’язковий `str`.
    
    І вам не потрібно оголошувати нічого іншого для цього параметра, тому вам насправді не потрібно використовувати `Query`.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:27:41 GMT 2026
    - 10K bytes
    - Click Count (0)
  5. fastapi/.agents/skills/fastapi/references/streaming.md

    ```python
    from collections.abc import AsyncIterable
    
    from fastapi import FastAPI
    from fastapi.sse import EventSourceResponse
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float
    
    
    @app.get("/items/stream", response_class=EventSourceResponse)
    async def stream_items() -> AsyncIterable[Item]:
        yield Item(name="Plumbus", price=32.99)
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 10:05:57 GMT 2026
    - 2.5K bytes
    - Click Count (0)
  6. tests/test_dependency_paramless.py

        SecurityScopes,
    )
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
    
    
    def process_auth(
        credentials: Annotated[str | None, Security(oauth2_scheme)],
        security_scopes: SecurityScopes,
    ):
        # This is an incorrect way of using it, this is not checking if the scopes are
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 2.3K bytes
    - Click Count (0)
  7. compat/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java

        private static String stripLeadingAndTrailingQuotes(String str) {
            final int length = str.length();
            if (length > 1
                    && str.startsWith("\"")
                    && str.endsWith("\"")
                    && str.substring(1, length - 1).indexOf('"') == -1) {
                str = str.substring(1, length - 1);
            }
    
            return str;
        }
    
    Created: Sun Apr 05 03:35:12 GMT 2026
    - Last Modified: Mon Oct 27 13:24:03 GMT 2025
    - 78.1K bytes
    - Click Count (0)
  8. docs/es/docs/advanced/settings.md

    Por ejemplo, si tienes una función:
    
    ```Python
    @lru_cache
    def say_hi(name: str, salutation: str = "Ms."):
        return f"Hello {salutation} {name}"
    ```
    
    tu programa podría ejecutarse así:
    
    ```mermaid
    sequenceDiagram
    
    participant code as Código
    participant function as say_hi()
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:15:55 GMT 2026
    - 11.7K bytes
    - Click Count (0)
  9. docs/fr/docs/advanced/custom-response.md

    Vous pouvez la renvoyer directement.
    
    Elle accepte les paramètres suivants :
    
    - `content` - Une `str` ou des `bytes`.
    - `status_code` - Un code d'état HTTP de type `int`.
    - `headers` - Un `dict` de chaînes.
    - `media_type` - Une `str` donnant le media type. Par exemple « text/html ».
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:37:13 GMT 2026
    - 12.3K bytes
    - Click Count (0)
  10. docs/fr/docs/tutorial/query-params.md

    {* ../../docs_src/query_params/tutorial005_py310.py hl[6:7] *}
    
    Ici, le paramètre de requête `needy` est un paramètre de requête requis de type `str`.
    
    Si vous ouvrez dans votre navigateur une URL comme :
    
    ```
    http://127.0.0.1:8000/items/foo-item
    ```
    
    ... sans ajouter le paramètre requis `needy`, vous verrez une erreur comme :
    
    ```JSON
    {
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:37:13 GMT 2026
    - 5.3K bytes
    - Click Count (0)
Back to Top