Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 111 - 120 of 685 for Dict (0.03 seconds)

  1. docs_src/response_model/tutorial003_04_py310.py

    from fastapi import FastAPI, Response
    from fastapi.responses import RedirectResponse
    
    app = FastAPI()
    
    
    @app.get("/portal")
    async def get_portal(teleport: bool = False) -> Response | dict:
        if teleport:
            return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Jan 10 16:22:47 GMT 2023
    - 352 bytes
    - Click Count (0)
  2. docs_src/body_nested_models/tutorial009_py310.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.post("/index-weights/")
    async def create_index_weights(weights: dict[int, float]):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 154 bytes
    - Click Count (0)
  3. docs/en/docs/tutorial/testing.md

    E.g.:
    
    * To pass a *path* or *query* parameter, add it to the URL itself.
    * To pass a JSON body, pass a Python object (e.g. a `dict`) to the parameter `json`.
    * If you need to send *Form Data* instead of JSON, use the `data` parameter instead.
    * To pass *headers*, use a `dict` in the `headers` parameter.
    * For *cookies*, a `dict` in the `cookies` parameter.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 5.7K bytes
    - Click Count (0)
  4. tests/test_request_params/test_file/utils.py

    from typing import Any
    
    
    def get_body_model_name(openapi: dict[str, Any], path: str) -> str:
        body = openapi["paths"][path]["post"]["requestBody"]
        body_schema = body["content"]["multipart/form-data"]["schema"]
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 271 bytes
    - Click Count (0)
  5. docs_src/extra_models/tutorial005_py310.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/keyword-weights/", response_model=dict[str, float])
    async def read_keyword_weights():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 180 bytes
    - Click Count (0)
  6. tests/test_dependency_overrides.py

    
    @app.get("/main-depends/")
    async def main_depends(commons: dict = Depends(common_parameters)):
        return {"in": "main-depends", "params": commons}
    
    
    @app.get("/decorator-depends/", dependencies=[Depends(common_parameters)])
    async def decorator_depends():
        return {"in": "decorator-depends"}
    
    
    @router.get("/router-depends/")
    async def router_depends(commons: dict = Depends(common_parameters)):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 11.2K bytes
    - Click Count (0)
  7. fastapi/.agents/skills/fastapi/references/dependencies.md

    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    @dataclass
    class DatabasePaginator:
        offset: int = 0
        limit: int = 100
        q: str | None = None
    
        def get_page(self) -> dict:
            # Simulate a page of data
            return {
                "offset": self.offset,
                "limit": self.limit,
                "q": self.q,
                "items": [],
            }
    
    
    def get_db_paginator(
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 10:05:57 GMT 2026
    - 3.2K bytes
    - Click Count (0)
  8. docs/zh/docs/python-types.md

    * 变量 `items_s` 是一个 `set`,其中每个元素的类型是 `bytes`。
    
    #### 字典 { #dict }
    
    定义 `dict` 时,需要传入 2 个类型参数,用逗号分隔。
    
    第一个类型参数用于字典的键。
    
    第二个类型参数用于字典的值:
    
    {* ../../docs_src/python_types/tutorial008_py310.py hl[1] *}
    
    这表示:
    
    * 变量 `prices` 是一个 `dict`:
        * 这个 `dict` 的键是 `str` 类型(比如,每个条目的名称)。
        * 这个 `dict` 的值是 `float` 类型(比如,每个条目的价格)。
    
    #### Union { #union }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 10.6K bytes
    - Click Count (0)
  9. docs/zh-hant/docs/tutorial/metadata.md

    | `description` | `str` | API 的簡短說明。可使用 Markdown。 |
    | `version` | `string` | API 的版本號。這是你自己的應用程式版本,不是 OpenAPI 的版本,例如 `2.5.0`。 |
    | `terms_of_service` | `str` | 指向 API 服務條款的 URL。若提供,必須是 URL。 |
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 5.6K bytes
    - Click Count (0)
  10. docs_src/response_model/tutorial003_05_py310.py

    from fastapi import FastAPI, Response
    from fastapi.responses import RedirectResponse
    
    app = FastAPI()
    
    
    @app.get("/portal", response_model=None)
    async def get_portal(teleport: bool = False) -> Response | dict:
        if teleport:
            return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Jan 10 16:22:47 GMT 2023
    - 373 bytes
    - Click Count (0)
Back to Top