Search Options

Results per page
Sort
Preferred Languages
Advance

Results 171 - 180 of 1,178 for strs (0.02 sec)

  1. docs_src/query_params/tutorial006_py310.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_user_item(
        item_id: str, needy: str, skip: int = 0, limit: int | None = None
    ):
        item = {"item_id": item_id, "needy": needy, "skip": skip, "limit": limit}
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 269 bytes
    - Viewed (0)
  2. docs_src/background_tasks/tutorial002_an_py310.py

    from typing import Annotated
    
    from fastapi import BackgroundTasks, Depends, FastAPI
    
    app = FastAPI()
    
    
    def write_log(message: str):
        with open("log.txt", mode="a") as log:
            log.write(message)
    
    
    def get_query(background_tasks: BackgroundTasks, q: str | None = None):
        if q:
            message = f"found query: {q}\n"
            background_tasks.add_task(write_log, message)
        return q
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 683 bytes
    - Viewed (0)
  3. docs_src/background_tasks/tutorial002_py39.py

    from typing import Union
    
    from fastapi import BackgroundTasks, Depends, FastAPI
    
    app = FastAPI()
    
    
    def write_log(message: str):
        with open("log.txt", mode="a") as log:
            log.write(message)
    
    
    def get_query(background_tasks: BackgroundTasks, q: Union[str, None] = None):
        if q:
            message = f"found query: {q}\n"
            background_tasks.add_task(write_log, message)
        return q
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 675 bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/extra-data-types.md

        * In requests and responses will be represented as a `str`.
    * `datetime.datetime`:
        * A Python `datetime.datetime`.
        * In requests and responses will be represented as a `str` in ISO 8601 format, like: `2008-09-15T15:53:00+05:00`.
    * `datetime.date`:
        * Python `datetime.date`.
        * In requests and responses will be represented as a `str` in ISO 8601 format, like: `2008-09-15`.
    * `datetime.time`:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 2.7K bytes
    - Viewed (0)
  5. docs/es/docs/tutorial/extra-data-types.md

        * En requests y responses se representará como un `str`.
    * `datetime.datetime`:
        * Un `datetime.datetime` de Python.
        * En requests y responses se representará como un `str` en formato ISO 8601, como: `2008-09-15T15:53:00+05:00`.
    * `datetime.date`:
        * `datetime.date` de Python.
        * En requests y responses se representará como un `str` en formato ISO 8601, como: `2008-09-15`.
    * `datetime.time`:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 16:33:45 UTC 2025
    - 2.9K bytes
    - Viewed (0)
  6. src/test/java/jcifs/pac/PacDataInputStreamTest.java

            PacDataInputStream pdis = createInputStream(data);
            PacUnicodeString str = pdis.readUnicodeString();
            assertEquals(4, str.getLength());
            assertEquals(4, str.getMaxLength());
            assertEquals(0x1234, str.getPointer());
        }
    
        @Test
        public void testReadUnicodeStringMalformed() throws IOException {
            // length > maxLength
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 9.2K bytes
    - Viewed (0)
  7. tests/test_invalid_sequence_param.py

            class Item(BaseModel):
                title: str
    
            @app.get("/items/")
            def read_items(q: dict[str, Item] = Query(default=None)):
                pass  # pragma: no cover
    
    
    def test_invalid_simple_dict():
        with pytest.raises(AssertionError):
            app = FastAPI()
    
            class Item(BaseModel):
                title: str
    
            @app.get("/items/")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 1.2K bytes
    - Viewed (0)
  8. docs_src/additional_responses/tutorial003_py39.py

    from fastapi import FastAPI
    from fastapi.responses import JSONResponse
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        id: str
        value: str
    
    
    class Message(BaseModel):
        message: str
    
    
    app = FastAPI()
    
    
    @app.get(
        "/items/{item_id}",
        response_model=Item,
        responses={
            404: {"model": Message, "description": "The item was not found"},
            200: {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 837 bytes
    - Viewed (0)
  9. docs_src/dataclasses_/tutorial003_py310.py

    
    @dataclass
    class Item:
        name: str
        description: str | None = None
    
    
    @dataclass
    class Author:
        name: str
        items: list[Item] = field(default_factory=list)  # (3)
    
    
    app = FastAPI()
    
    
    @app.post("/authors/{author_id}/items/", response_model=Author)  # (4)
    async def create_author_items(author_id: str, items: list[Item]):  # (5)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  10. docs_src/dataclasses_/tutorial003_py39.py

    
    @dataclass
    class Item:
        name: str
        description: Union[str, None] = None
    
    
    @dataclass
    class Author:
        name: str
        items: list[Item] = field(default_factory=list)  # (3)
    
    
    app = FastAPI()
    
    
    @app.post("/authors/{author_id}/items/", response_model=Author)  # (4)
    async def create_author_items(author_id: str, items: list[Item]):  # (5)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 1.4K bytes
    - Viewed (0)
Back to top