Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for geturl (0.25 sec)

  1. docs_src/dependency_testing/tutorial001_py310.py

        return {"q": q, "skip": skip, "limit": limit}
    
    
    @app.get("/items/")
    async def read_items(commons: dict = Depends(common_parameters)):
        return {"message": "Hello Items!", "params": commons}
    
    
    @app.get("/users/")
    async def read_users(commons: dict = Depends(common_parameters)):
        return {"message": "Hello Users!", "params": commons}
    
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 1.4K bytes
    - Viewed (0)
  2. docs_src/extra_models/tutorial001_py310.py

        full_name: str | None = None
    
    
    def fake_password_hasher(raw_password: str):
        return "supersecret" + raw_password
    
    
    def fake_save_user(user_in: UserIn):
        hashed_password = fake_password_hasher(user_in.password)
        user_in_db = UserInDB(**user_in.dict(), hashed_password=hashed_password)
        print("User saved! ..not really")
        return user_in_db
    
    
    @app.post("/user/", response_model=UserOut)
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 899 bytes
    - Viewed (0)
  3. docs_src/cookie_params/tutorial001_py310.py

    from fastapi import Cookie, FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(ads_id: str | None = Cookie(default=None)):
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 170 bytes
    - Viewed (0)
  4. docs_src/path_operation_configuration/tutorial001_py310.py

        price: float
        tax: float | None = None
        tags: set[str] = set()
    
    
    @app.post("/items/", response_model=Item, status_code=status.HTTP_201_CREATED)
    async def create_item(item: Item):
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 363 bytes
    - Viewed (0)
  5. docs_src/extra_data_types/tutorial001_py310.py

        process_after: timedelta = Body(),
        repeat_at: time | None = Body(default=None),
    ):
        start_process = start_datetime + process_after
        duration = end_datetime - start_process
        return {
            "item_id": item_id,
            "start_datetime": start_datetime,
            "end_datetime": end_datetime,
            "process_after": process_after,
            "repeat_at": repeat_at,
            "start_process": start_process,
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 724 bytes
    - Viewed (0)
  6. docs_src/dependencies/tutorial001_py310.py

    
    async def common_parameters(q: str | None = None, skip: int = 0, limit: int = 100):
        return {"q": q, "skip": skip, "limit": limit}
    
    
    @app.get("/items/")
    async def read_items(commons: dict = Depends(common_parameters)):
        return commons
    
    
    @app.get("/users/")
    async def read_users(commons: dict = Depends(common_parameters)):
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 404 bytes
    - Viewed (0)
  7. docs_src/response_model/tutorial001_py310.py

        price: float
        tax: float | None = None
        tags: list[str] = []
    
    
    @app.post("/items/", response_model=Item)
    async def create_item(item: Item) -> Any:
        return item
    
    
    @app.get("/items/", response_model=list[Item])
    async def read_items() -> Any:
        return [
            {"name": "Portal Gun", "price": 42.0},
            {"name": "Plumbus", "price": 32.0},
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 537 bytes
    - Viewed (0)
  8. docs_src/body_updates/tutorial001_py310.py

    }
    
    
    @app.get("/items/{item_id}", response_model=Item)
    async def read_item(item_id: str):
        return items[item_id]
    
    
    @app.put("/items/{item_id}", response_model=Item)
    async def update_item(item_id: str, item: Item):
        update_item_encoded = jsonable_encoder(item)
        items[item_id] = update_item_encoded
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 856 bytes
    - Viewed (0)
  9. docs_src/body/tutorial001_py310.py

    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
    
    app = FastAPI()
    
    
    @app.post("/items/")
    async def create_item(item: Item):
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 271 bytes
    - Viewed (0)
  10. docs_src/query_params_str_validations/tutorial001_py310.py

    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: str | None = None):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 239 bytes
    - Viewed (0)
Back to top