Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 521 - 530 of 795 for asyncId (0.05 seconds)

  1. docs_src/extra_models/tutorial001_py310.py

        user_in_db = UserInDB(**user_in.model_dump(), hashed_password=hashed_password)
        print("User saved! ..not really")
        return user_in_db
    
    
    @app.post("/user/", response_model=UserOut)
    async def create_user(user_in: UserIn):
        user_saved = fake_save_user(user_in)
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 905 bytes
    - Click Count (0)
  2. docs_src/path_operation_advanced_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
    - 661 bytes
    - Click Count (0)
  3. docs_src/server_sent_events/tutorial004_py310.py

    
    items = [
        Item(name="Plumbus", price=32.99),
        Item(name="Portal Gun", price=999.99),
        Item(name="Meeseeks Box", price=49.99),
    ]
    
    
    @app.get("/items/stream", response_class=EventSourceResponse)
    async def stream_items(
        last_event_id: Annotated[int | None, Header()] = None,
    ) -> AsyncIterable[ServerSentEvent]:
        start = last_event_id + 1 if last_event_id is not None else 0
        for i, item in enumerate(items):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 09:21:52 GMT 2026
    - 795 bytes
    - Click Count (0)
  4. docs/pt/docs/tutorial/stream-json-lines.md

    ///
    
    ### Funções de operação de rota não assíncronas { #non-async-path-operation-functions }
    
    Você também pode usar funções `def` normais (sem `async`) e usar `yield` da mesma forma.
    
    O FastAPI garantirá que sejam executadas corretamente para não bloquear o event loop.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:13 GMT 2026
    - 4.6K bytes
    - Click Count (0)
  5. docs_src/query_params_str_validations/tutorial003_py310.py

    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: str | None = Query(default=None, min_length=3, max_length=50)):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 290 bytes
    - Click Count (0)
  6. docs/es/docs/index.md

    ```
    
    <details markdown="1">
    <summary>O usa <code>async def</code>...</summary>
    
    Si tu código usa `async` / `await`, usa `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: Thu Mar 19 18:15:55 GMT 2026
    - 22.6K bytes
    - Click Count (0)
  7. docs/pt/docs/index.md

    ```
    
    <details markdown="1">
    <summary>Ou use <code>async def</code>...</summary>
    
    Se seu código utiliza `async` / `await`, use `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: Thu Mar 19 18:20:43 GMT 2026
    - 22.7K bytes
    - Click Count (0)
  8. docs_src/handling_errors/tutorial001_py310.py

    from fastapi import FastAPI, HTTPException
    
    app = FastAPI()
    
    items = {"foo": "The Foo Wrestlers"}
    
    
    @app.get("/items/{item_id}")
    async def read_item(item_id: str):
        if item_id not in items:
            raise HTTPException(status_code=404, detail="Item not found")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 299 bytes
    - Click Count (0)
  9. docs_src/path_params_numeric_validations/tutorial003_py310.py

    from fastapi import FastAPI, Path
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_items(*, item_id: int = Path(title="The ID of the item to get"), q: str):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 268 bytes
    - Click Count (0)
  10. docs_src/query_params_str_validations/tutorial005_an_py310.py

    from typing import Annotated
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Annotated[str, Query(min_length=3)] = "fixedquery"):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 309 bytes
    - Click Count (0)
Back to Top