Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 601 - 610 of 795 for asyncId (0.42 seconds)

  1. docs_src/schema_extra_example/tutorial005_an_py310.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        *,
        item_id: int,
        item: Annotated[
            Item,
            Body(
                openapi_examples={
                    "normal": {
                        "summary": "A normal example",
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Aug 26 18:03:13 GMT 2023
    - 1.5K bytes
    - Click Count (0)
  2. docs/es/docs/tutorial/background-tasks.md

    Es solo una función estándar que puede recibir parámetros.
    
    Puede ser una función `async def` o una función normal `def`, **FastAPI** sabrá cómo manejarla correctamente.
    
    En este caso, la función de tarea escribirá en un archivo (simulando el envío de un email).
    
    Y como la operación de escritura no usa `async` y `await`, definimos la función con un `def` normal:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:15:55 GMT 2026
    - 5K bytes
    - Click Count (0)
  3. docs/uk/docs/alternatives.md

    ### [Sanic](https://sanic.readthedocs.io/en/latest/) { #sanic }
    
    Це був один із перших надзвичайно швидких фреймворків Python на основі `asyncio`. Він був дуже схожий на Flask.
    
    /// note | Технічні деталі
    
    Він використовував [`uvloop`](https://github.com/MagicStack/uvloop) замість стандартного циклу Python `asyncio`. Ось що зробило його таким швидким.
    
    Це явно надихнуло Uvicorn і Starlette, які зараз швидші за Sanic у відкритих тестах.
    
    ///
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:27:41 GMT 2026
    - 37.2K bytes
    - Click Count (0)
  4. tests/test_security_oauth2_authorization_code_bearer_description.py

    app = FastAPI()
    
    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")
    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)
  5. 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)
  6. docs/pt/docs/tutorial/request-files.md

    ```Python
    contents = myfile.file.read()
    ```
    
    /// note | Detalhes Técnicos do `async`
    
    Quando você usa os métodos `async`, o **FastAPI** executa os métodos de arquivo em um threadpool e aguarda por eles.
    
    ///
    
    /// note | Detalhes Técnicos do Starlette
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:43 GMT 2026
    - 7.8K bytes
    - Click Count (0)
  7. src/test/java/jcifs/internal/RequestTest.java

            }
        }
    
        /**
         * Test implementation of CommonServerMessageBlockResponse
         */
        private static class TestResponse implements CommonServerMessageBlockResponse {
            private boolean async = false;
            private CommonServerMessageBlockResponse nextResponse;
            private boolean received = false;
            private int errorCode = 0;
            private long mid = 0;
            private Long expiration = null;
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 14.5K bytes
    - Click Count (0)
  8. tests/test_top_level_security_scheme_in_openapi.py

    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    app = FastAPI()
    
    bearer_scheme = HTTPBearer()
    
    
    @app.get("/", dependencies=[Depends(bearer_scheme)])
    async def get_root():
        return {"message": "Hello, World!"}
    
    
    client = TestClient(app)
    
    
    def test_get_root():
        response = client.get("/", headers={"Authorization": "Bearer token"})
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Nov 24 19:03:06 GMT 2025
    - 1.9K bytes
    - Click Count (0)
  9. tests/test_datastructures.py

        assert testing_file_store
        assert testing_file_store[0].file.closed
    
    
    # For UploadFile coverage, segments copied from Starlette tests
    
    
    @pytest.mark.anyio
    async def test_upload_file():
        stream = io.BytesIO(b"data")
        file = UploadFile(filename="file", file=stream, size=4)
        assert await file.read() == b"data"
        assert file.size == 4
        await file.write(b" and more data!")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 1.8K bytes
    - Click Count (0)
  10. docs/pt/docs/tutorial/background-tasks.md

    É apenas uma função padrão que pode receber parâmetros.
    
    Pode ser uma função `async def` ou um `def` normal, o **FastAPI** saberá como lidar com isso corretamente.
    
    Neste caso, a função da tarefa escreverá em um arquivo (simulando o envio de um e-mail).
    
    E como a operação de escrita não usa `async` e `await`, definimos a função com um `def` normal:
    
    {* ../../docs_src/background_tasks/tutorial001_py310.py hl[6:9] *}
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:43 GMT 2026
    - 5.1K bytes
    - Click Count (0)
Back to Top