Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for delete_item (0.3 sec)

  1. tests/test_extra_routes.py

    
    def get_not_decorated(item_id: str):
        return {"item_id": item_id}
    
    
    app.add_api_route("/items-not-decorated/{item_id}", get_not_decorated)
    
    
    @app.delete("/items/{item_id}")
    def delete_item(item_id: str, item: Item):
        return {"item_id": item_id, "item": item}
    
    
    @app.head("/items/{item_id}")
    def head_item(item_id: str):
        return JSONResponse(None, headers={"x-fastapi-item-id": item_id})
    
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 13.7K bytes
    - Viewed (0)
  2. fastapi/routing.py

            ```python
            from fastapi import APIRouter, FastAPI
    
            app = FastAPI()
            router = APIRouter()
    
            @router.delete("/items/{item_id}")
            def delete_item(item_id: str):
                return {"message": "Item deleted"}
    
            app.include_router(router)
            ```
            """
            return self.api_route(
                path=path,
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Apr 02 02:48:51 UTC 2024
    - 170.1K bytes
    - Viewed (0)
  3. fastapi/applications.py

            ## Example
    
            ```python
            from fastapi import FastAPI
    
            app = FastAPI()
    
            @app.delete("/items/{item_id}")
            def delete_item(item_id: str):
                return {"message": "Item deleted"}
            ```
            """
            return self.router.delete(
                path,
                response_model=response_model,
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat May 18 00:48:03 UTC 2024
    - 172.2K bytes
    - Viewed (0)
  4. docs/en/docs/release-notes.md

        ...
    
    
    @app.get("/items/{item_id}")
    def read_item(*, user: User = Depends(get_current_user), item_id: int):
        ...
    
    
    @app.delete("/items/{item_id}")
    def delete_item(*, user: User = Depends(get_current_user), item_id: int):
        ...
    ```
    
    There's a bit of code duplication for the dependency:
    
    ```Python
    user: User = Depends(get_current_user)
    ```
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 14 15:07:37 UTC 2024
    - 395.4K bytes
    - Viewed (0)
Back to top