Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 581 - 590 of 795 for asyncId (0.06 seconds)

  1. tests/test_reponse_set_reponse_code_empty.py

    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    app = FastAPI()
    
    
    @app.delete(
        "/{id}",
        status_code=204,
        response_model=None,
    )
    async def delete_deployment(
        id: int,
        response: Response,
    ) -> Any:
        response.status_code = 400
        return {"msg": "Status overwritten", "id": id}
    
    
    client = TestClient(app)
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:18:38 GMT 2026
    - 3.6K bytes
    - Click Count (0)
  2. docs/ko/docs/tutorial/background-tasks.md

    ## 작업 함수 생성 { #create-a-task-function }
    
    백그라운드 작업으로 실행할 함수를 생성합니다.
    
    이는 매개변수를 받을 수 있는 표준 함수일 뿐입니다.
    
    `async def` 함수일 수도, 일반 `def` 함수일 수도 있으며, **FastAPI**가 이를 올바르게 처리하는 방법을 알고 있습니다.
    
    이 경우 작업 함수는 파일에 쓰기를 수행합니다(이메일 전송을 시뮬레이션).
    
    그리고 쓰기 작업은 `async`와 `await`를 사용하지 않으므로, 일반 `def`로 함수를 정의합니다:
    
    {* ../../docs_src/background_tasks/tutorial001_py310.py hl[6:9] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 5.2K bytes
    - Click Count (0)
  3. docs_src/path_operation_configuration/tutorial004_py310.py

    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
        tags: set[str] = set()
    
    
    @app.post("/items/", summary="Create an item")
    async def create_item(item: Item) -> Item:
        """
        Create an item with all the information:
    
        - **name**: each item must have a name
        - **description**: a long description
        - **price**: required
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Feb 04 12:07:26 GMT 2026
    - 625 bytes
    - Click Count (0)
  4. tests/test_security_oauth2_authorization_code_bearer.py

    from inline_snapshot import snapshot
    
    app = FastAPI()
    
    oauth2_scheme = OAuth2AuthorizationCodeBearer(
        authorizationUrl="authorize", tokenUrl="token", 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.7K bytes
    - Click Count (0)
  5. docs_src/metadata/tutorial001_py310.py

            "email": "******@****.***",
        },
        license_info={
            "name": "Apache 2.0",
            "url": "https://www.apache.org/licenses/LICENSE-2.0.html",
        },
    )
    
    
    @app.get("/items/")
    async def read_items():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 805 bytes
    - Click Count (0)
  6. fastapi/dependencies/models.py

    from fastapi.security.base import SecurityBase
    from fastapi.types import DependencyCacheKey
    
    if sys.version_info >= (3, 13):  # pragma: no cover
        from inspect import iscoroutinefunction
    else:  # pragma: no cover
        from asyncio import iscoroutinefunction
    
    
    def _unwrapped_call(call: Callable[..., Any] | None) -> Any:
        if call is None:
            return call  # pragma: no cover
        unwrapped = inspect.unwrap(_impartial(call))
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Feb 11 18:41:21 GMT 2026
    - 7.1K bytes
    - Click Count (0)
  7. docs/ja/docs/index.md

    ```
    
    <details markdown="1">
    <summary>または <code>async def</code> を使います...</summary>
    
    コードで `async` / `await` を使用する場合は、`async def` を使います。
    
    ```Python hl_lines="7  12"
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    async def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    async def read_item(item_id: int, q: str | None = None):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 25.6K bytes
    - Click Count (0)
  8. docs/es/docs/tutorial/first-steps.md

    En este caso, es una función `async`.
    
    ---
    
    También podrías definirla como una función normal en lugar de `async def`:
    
    {* ../../docs_src/first_steps/tutorial003_py310.py hl[7] *}
    
    /// note | Nota
    
    Si no sabes la diferencia, Revisa la sección [Async: *"¿Tienes prisa?"*](../async.md#in-a-hurry).
    
    ///
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:15:55 GMT 2026
    - 13.9K bytes
    - Click Count (0)
  9. docs/pt/docs/tutorial/first-steps.md

    Neste caso, é uma função `async`.
    
    ---
    
    Você também pode defini-la como uma função normal em vez de `async def`:
    
    {* ../../docs_src/first_steps/tutorial003_py310.py hl[7] *}
    
    /// note | Nota
    
    Se você não sabe a diferença, verifique o [Async: *"Com pressa?"*](../async.md#in-a-hurry).
    
    ///
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:43 GMT 2026
    - 14.2K bytes
    - Click Count (0)
  10. docs/tr/docs/tutorial/first-steps.md

    Bu durumda, bu bir `async` fonksiyondur.
    
    ---
    
    Bunu `async def` yerine normal bir fonksiyon olarak da tanımlayabilirsiniz:
    
    {* ../../docs_src/first_steps/tutorial003_py310.py hl[7] *}
    
    /// note | Not
    
    Eğer farkı bilmiyorsanız, [Async: *"Aceleniz mi var?"*](../async.md#in-a-hurry) sayfasına bakın.
    
    ///
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 07:53:17 GMT 2026
    - 14.4K bytes
    - Click Count (0)
Back to Top