Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 51 - 60 of 213 for response_mode (0.07 seconds)

  1. docs_src/response_model/tutorial001_py39.py

        description: Union[str, None] = None
        price: float
        tax: Union[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},
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 556 bytes
    - Click Count (0)
  2. docs_src/response_model/tutorial006_py39.py

            "price": 50.2,
            "tax": 10.5,
        },
    }
    
    
    @app.get(
        "/items/{item_id}/name",
        response_model=Item,
        response_model_include=["name", "description"],
    )
    async def read_item_name(item_id: str):
        return items[item_id]
    
    
    @app.get("/items/{item_id}/public", response_model=Item, response_model_exclude=["tax"])
    async def read_item_public_data(item_id: str):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 848 bytes
    - Click Count (0)
  3. docs/zh/docs/advanced/response-cookies.md

    {* ../../docs_src/response_cookies/tutorial002.py hl[1,8:9] *}
    
    而且你还可以根据你的需要响应不同的对象,比如常用的 `dict`,数据库model等。
    
    如果你定义了 `response_model`,程序会自动根据`response_model`来过滤和转换你响应的对象。
    
    **FastAPI** 会使用这个 *临时* 响应对象去装在这些cookies信息 (同样还有headers和状态码等信息), 最终会将这些信息和通过`response_model`转化过的数据合并到最终的响应里。
    
    你也可以在depend中定义`Response`参数,并设置cookie和header。
    
    ## 直接响应 `Response`
    
    你还可以在直接响应`Response`时直接创建cookies。
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Oct 11 17:48:49 GMT 2025
    - 2.1K bytes
    - Click Count (0)
  4. internal/dsync/lock-args.go

    	Quorum *int `msgp:"omitempty"`
    }
    
    // ResponseCode is the response code for a locking request.
    type ResponseCode uint8
    
    // Response codes for a locking request.
    const (
    	RespOK ResponseCode = iota
    	RespLockConflict
    	RespLockNotInitialized
    	RespLockNotFound
    	RespErr
    )
    
    // LockResp is a locking request response.
    type LockResp struct {
    	Code ResponseCode
    	Err  string
    Created: Sun Dec 28 19:28:13 GMT 2025
    - Last Modified: Wed Jul 24 10:24:01 GMT 2024
    - 1.8K bytes
    - Click Count (0)
  5. docs_src/response_model/tutorial005_py310.py

            "price": 50.2,
            "tax": 10.5,
        },
    }
    
    
    @app.get(
        "/items/{item_id}/name",
        response_model=Item,
        response_model_include={"name", "description"},
    )
    async def read_item_name(item_id: str):
        return items[item_id]
    
    
    @app.get("/items/{item_id}/public", response_model=Item, response_model_exclude={"tax"})
    async def read_item_public_data(item_id: str):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 816 bytes
    - Click Count (0)
  6. docs_src/response_model/tutorial005_py39.py

            "price": 50.2,
            "tax": 10.5,
        },
    }
    
    
    @app.get(
        "/items/{item_id}/name",
        response_model=Item,
        response_model_include={"name", "description"},
    )
    async def read_item_name(item_id: str):
        return items[item_id]
    
    
    @app.get("/items/{item_id}/public", response_model=Item, response_model_exclude={"tax"})
    async def read_item_public_data(item_id: str):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 848 bytes
    - Click Count (0)
  7. docs/es/docs/advanced/response-cookies.md

    Y si declaraste un `response_model`, todavía se utilizará para filtrar y convertir el objeto que devolviste.
    
    **FastAPI** utilizará ese response *temporal* para extraer las cookies (también los headers y el código de estado), y las pondrá en el response final que contiene el valor que devolviste, filtrado por cualquier `response_model`.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 2.5K bytes
    - Click Count (0)
  8. docs/ko/docs/advanced/response-cookies.md

    {* ../../docs_src/response_cookies/tutorial002.py hl[1,8:9] *}
    
    그런 다음 필요한 객체(`dict`, 데이터베이스 모델 등)를 반환할 수 있습니다.
    
    그리고 `response_model`을 선언했다면 반환한 객체를 거르고 변환하는 데 여전히 사용됩니다.
    
    **FastAPI**는 그 *임시* 응답에서 쿠키(또한 헤더 및 상태 코드)를 추출하고, 반환된 값이 포함된 최종 응답에 이를 넣습니다. 이 값은 `response_model`로 걸러지게 됩니다.
    
    또한 의존관계에서 `Response` 매개변수를 선언하고, 해당 의존성에서 쿠키(및 헤더)를 설정할 수도 있습니다.
    
    ## `Response`를 직접 반환하기
    
    코드에서 `Response`를 직접 반환할 때도 쿠키를 생성할 수 있습니다.
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Oct 11 17:48:49 GMT 2025
    - 2.4K bytes
    - Click Count (0)
  9. docs_src/body_updates/tutorial002_py39.py

        "baz": {"name": "Baz", "description": None, "price": 50.2, "tax": 10.5, "tags": []},
    }
    
    
    @app.get("/items/{item_id}", response_model=Item)
    async def read_item(item_id: str):
        return items[item_id]
    
    
    @app.patch("/items/{item_id}", response_model=Item)
    async def update_item(item_id: str, item: Item):
        stored_item_data = items[item_id]
        stored_item_model = Item(**stored_item_data)
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 1K bytes
    - Click Count (0)
  10. docs/ko/docs/advanced/response-change-status-code.md

    {* ../../docs_src/response_change_status_code/tutorial001.py hl[1,9,12] *}
    
    그리고 평소처럼 원하는 객체(`dict`, 데이터베이스 모델 등)를 반환할 수 있습니다.
    
    `response_model`을 선언했다면 반환된 객체는 여전히 필터링되고 변환됩니다.
    
    **FastAPI**는 이 *임시* 응답 객체에서 상태 코드(쿠키와 헤더 포함)를 추출하여, `response_model`로 필터링된 반환 값을 최종 응답에 넣습니다.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Mon Nov 18 02:25:44 GMT 2024
    - 1.7K bytes
    - Click Count (0)
Back to Top