Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for 1000 (0.16 sec)

  1. docs_src/path_params_numeric_validations/tutorial006.py

    from fastapi import FastAPI, Path, Query
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_items(
        *,
        item_id: int = Path(title="The ID of the item to get", ge=0, le=1000),
        q: str,
        size: float = Query(gt=0, lt=10.5),
    ):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 10 18:49:18 GMT 2023
    - 345 bytes
    - Viewed (0)
  2. docs_src/advanced_middleware/tutorial003.py

    from fastapi import FastAPI
    from fastapi.middleware.gzip import GZipMiddleware
    
    app = FastAPI()
    
    app.add_middleware(GZipMiddleware, minimum_size=1000)
    
    
    @app.get("/")
    async def main():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 213 bytes
    - Viewed (0)
  3. docs_src/path_params_numeric_validations/tutorial005_an.py

    from fastapi import FastAPI, Path
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_items(
        item_id: Annotated[int, Path(title="The ID of the item to get", gt=0, le=1000)],
        q: str,
    ):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 341 bytes
    - Viewed (0)
  4. docs_src/path_params_numeric_validations/tutorial005_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, Path
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_items(
        item_id: Annotated[int, Path(title="The ID of the item to get", gt=0, le=1000)],
        q: str,
    ):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 331 bytes
    - Viewed (0)
  5. docs_src/body_multiple_params/tutorial001_an_py39.py

        price: float
        tax: Union[float, None] = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        item_id: Annotated[int, Path(title="The ID of the item to get", ge=0, le=1000)],
        q: Union[str, None] = None,
        item: Union[Item, None] = None,
    ):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
        if item:
            results.update({"item": item})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 610 bytes
    - Viewed (0)
  6. docs_src/path_params_numeric_validations/tutorial005.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", gt=0, le=1000),
        q: str,
    ):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 298 bytes
    - Viewed (0)
  7. docs_src/path_params_numeric_validations/tutorial006_an_py39.py

    from fastapi import FastAPI, Path, Query
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_items(
        *,
        item_id: Annotated[int, Path(title="The ID of the item to get", ge=0, le=1000)],
        q: str,
        size: Annotated[float, Query(gt=0, lt=10.5)],
    ):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 395 bytes
    - Viewed (0)
  8. docs_src/body_multiple_params/tutorial001_an.py

        price: float
        tax: Union[float, None] = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        item_id: Annotated[int, Path(title="The ID of the item to get", ge=0, le=1000)],
        q: Union[str, None] = None,
        item: Union[Item, None] = None,
    ):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
        if item:
            results.update({"item": item})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 639 bytes
    - Viewed (0)
  9. tests/test_tutorial/test_custom_request_and_route/test_tutorial001.py

        return {"request_class": type(request).__name__}
    
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize("compress", [True, False])
    def test_gzip_request(compress):
        n = 1000
        headers = {}
        body = [1] * n
        data = json.dumps(body).encode()
        if compress:
            data = gzip.compress(data)
            headers["Content-Encoding"] = "gzip"
        headers["Content-Type"] = "application/json"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Nov 13 14:26:09 GMT 2022
    - 886 bytes
    - Viewed (0)
  10. docs_src/path_params_numeric_validations/tutorial006_an.py

    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_items(
        *,
        item_id: Annotated[int, Path(title="The ID of the item to get", ge=0, le=1000)],
        q: str,
        size: Annotated[float, Query(gt=0, lt=10.5)],
    ):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 405 bytes
    - Viewed (0)
Back to top