Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 69 for plumbus (0.04 sec)

  1. docs_src/dependencies/tutorial008c_an_py39.py

        if item_id == "portal-gun":
            raise InternalError(
                f"The portal gun is too dangerous to be owned by {username}"
            )
        if item_id != "plumbus":
            raise HTTPException(
                status_code=404, detail="Item not found, there's only a plumbus here"
            )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Feb 24 23:06:37 UTC 2024
    - 700 bytes
    - Viewed (0)
  2. docs/ru/docs/tutorial/query-param-models.md

    Если клиент попробует отправить **дополнительные** данные в **query-параметрах**, то в ответ он получит **ошибку**.
    
    Например, если клиент попытается отправить query-параметр `tool` с значением `plumbus`, в виде:
    
    ```http
    https://example.com/items/?limit=10&tool=plumbus
    ```
    
    То в ответ он получит **ошибку**, сообщающую ему, что query-параметр `tool` не разрешен:
    
    ```json
    {
        "detail": [
            {
                "type": "extra_forbidden",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Sep 30 11:24:39 UTC 2025
    - 3.4K bytes
    - Viewed (0)
  3. docs_src/response_model/tutorial001_01_py310.py

    @app.post("/items/")
    async def create_item(item: Item) -> Item:
        return item
    
    
    @app.get("/items/")
    async def read_items() -> list[Item]:
        return [
            Item(name="Portal Gun", price=42.0),
            Item(name="Plumbus", price=32.0),
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Jan 07 13:45:48 UTC 2023
    - 469 bytes
    - Viewed (0)
  4. tests/test_tutorial/test_dependencies/test_tutorial008d.py

        assert response.json() == {"detail": "Item not found, there's only a plumbus here"}
    
    
    def test_get(mod: ModuleType):
        client = TestClient(mod.app)
        response = client.get("/items/plumbus")
        assert response.status_code == 200, response.text
        assert response.json() == "plumbus"
    
    
    def test_internal_error(mod: ModuleType):
        client = TestClient(mod.app)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.4K bytes
    - Viewed (0)
  5. docs_src/dependencies/tutorial008b_py39.py

    from fastapi import Depends, FastAPI, HTTPException
    
    app = FastAPI()
    
    
    data = {
        "plumbus": {"description": "Freshly pickled plumbus", "owner": "Morty"},
        "portal-gun": {"description": "Gun to create portals", "owner": "Rick"},
    }
    
    
    class OwnerError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except OwnerError as e:
            raise HTTPException(status_code=400, detail=f"Owner error: {e}")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 735 bytes
    - Viewed (0)
  6. docs_src/dependencies/tutorial012_py39.py

        return x_key
    
    
    app = FastAPI(dependencies=[Depends(verify_token), Depends(verify_key)])
    
    
    @app.get("/items/")
    async def read_items():
        return [{"item": "Portal Gun"}, {"item": "Plumbus"}]
    
    
    @app.get("/users/")
    async def read_users():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 696 bytes
    - Viewed (0)
  7. docs_src/dependencies/tutorial008c_py39.py

        if item_id == "portal-gun":
            raise InternalError(
                f"The portal gun is too dangerous to be owned by {username}"
            )
        if item_id != "plumbus":
            raise HTTPException(
                status_code=404, detail="Item not found, there's only a plumbus here"
            )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 660 bytes
    - Viewed (0)
  8. docs/uk/docs/tutorial/header-param-models.md

    Наприклад, якщо клієнт спробує надіслати заголовок `tool` зі значенням `plumbus`, він отримає  **помилку** з повідомленням про те, що параметр заголовка `tool` не дозволений:
    
    ```json
    {
        "detail": [
            {
                "type": "extra_forbidden",
                "loc": ["header", "tool"],
                "msg": "Extra inputs are not permitted",
                "input": "plumbus",
            }
        ]
    }
    ```
    
    ## Підсумок
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Mar 19 17:03:13 UTC 2025
    - 3K bytes
    - Viewed (0)
  9. docs_src/dependencies/tutorial008b_an_py39.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI, HTTPException
    
    app = FastAPI()
    
    
    data = {
        "plumbus": {"description": "Freshly pickled plumbus", "owner": "Morty"},
        "portal-gun": {"description": "Gun to create portals", "owner": "Rick"},
    }
    
    
    class OwnerError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except OwnerError as e:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 26 20:37:34 UTC 2023
    - 775 bytes
    - Viewed (0)
  10. docs/ko/docs/tutorial/query-param-models.md

    {* ../../docs_src/query_param_models/tutorial002_an_py310.py hl[10] *}
    
    만약 클라이언트가 쿼리 매개변수로 **추가적인** 데이터를 보내려고 하면, 클라이언트는 **에러** 응답을 받게 됩니다.
    
    예를 들어, 아래와 같이 만약 클라이언트가 `tool` 쿼리 매개변수에 `plumbus` 라는 값을 추가해서 보내려고 하면,
    
    ```http
    https://example.com/items/?limit=10&tool=plumbus
    ```
    
    클라이언트는 쿼리 매개변수 `tool` 이 허용되지 않는다는 **에러** 응답을 받게 됩니다.
    
    ```json
    {
        "detail": [
            {
                "type": "extra_forbidden",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Nov 20 19:24:08 UTC 2024
    - 2.3K bytes
    - Viewed (0)
Back to top