Search Options

Results per page
Sort
Preferred Languages
Advance

Results 231 - 240 of 1,205 for itens (0.02 sec)

  1. docs/pt/docs/tutorial/path-params.md

    O valor do parâmetro de path `item_id` será passado para a sua função como o argumento `item_id`.
    
    Então, se você executar este exemplo e acessar <a href="http://127.0.0.1:8000/items/foo" class="external-link" target="_blank">http://127.0.0.1:8000/items/foo</a>, você verá uma resposta:
    
    ```JSON
    {"item_id":"foo"}
    ```
    
    ## Parâmetros de path com tipos { #path-parameters-with-types }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 9.8K bytes
    - Viewed (0)
  2. docs_src/query_params_str_validations/tutorial015_an_py39.py

            raise ValueError('Invalid ID format, it must start with "isbn-" or "imdb-"')
        return id
    
    
    @app.get("/items/")
    async def read_items(
        id: Annotated[Union[str, None], AfterValidator(check_valid_id)] = None,
    ):
        if id:
            item = data.get(id)
        else:
            id, item = random.choice(list(data.items()))
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 01 22:02:35 UTC 2025
    - 781 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_path_operation_configurations/test_tutorial001.py

            f"docs_src.path_operation_configuration.{request.param}"
        )
        return TestClient(mod.app)
    
    
    def test_post_items(client: TestClient):
        response = client.post(
            "/items/",
            json={
                "name": "Foo",
                "description": "Item description",
                "price": 42.0,
                "tax": 3.2,
                "tags": ["bar", "baz"],
            },
        )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 6.2K bytes
    - Viewed (0)
  4. docs_src/query_params_str_validations/tutorial006c_py310.py

    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: str | None = Query(min_length=3)):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Feb 15 16:23:59 UTC 2025
    - 261 bytes
    - Viewed (0)
  5. docs_src/query_params_str_validations/tutorial006_py39.py

    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: str = Query(min_length=3)):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 254 bytes
    - Viewed (0)
  6. docs_src/query_params_str_validations/tutorial001_py39.py

    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Union[str, None] = None):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 271 bytes
    - Viewed (0)
  7. docs_src/security/tutorial005_py310.py

        hashed_password: str
    
    
    password_hash = PasswordHash.recommended()
    
    oauth2_scheme = OAuth2PasswordBearer(
        tokenUrl="token",
        scopes={"me": "Read information about the current user.", "items": "Read items."},
    )
    
    app = FastAPI()
    
    
    def verify_password(plain_password, hashed_password):
        return password_hash.verify(plain_password, hashed_password)
    
    
    def get_password_hash(password):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Sep 29 02:57:38 UTC 2025
    - 5.2K bytes
    - Viewed (0)
  8. docs_src/query_params_str_validations/tutorial005_py39.py

    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: str = Query(default="fixedquery", min_length=3)):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 276 bytes
    - Viewed (0)
  9. tests/test_infer_param_optionality.py

    
    def test_get_item_1():
        """Check that /items/{item_id} returns expected data"""
        response = client.get("/items/item01")
        assert response.status_code == 200, response.text
        assert response.json() == {"item_id": "item01"}
    
    
    def test_get_item_2():
        """Check that /items/{item_id} returns expected data with user_id specified"""
        response = client.get("/items/item01?user_id=abc123")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 12.1K bytes
    - Viewed (0)
  10. docs_src/query_params_str_validations/tutorial005_an_py39.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})
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 309 bytes
    - Viewed (0)
Back to top