Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 242 for imag (0.03 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. tests/test_tutorial/test_additional_responses/test_tutorial002.py

    
    def test_path_operation_img(client: TestClient):
        shutil.copy("./docs/en/docs/img/favicon.png", "./image.png")
        response = client.get("/items/foo?img=1")
        assert response.status_code == 200, response.text
        assert response.headers["Content-Type"] == "image/png"
        assert len(response.content)
        os.remove("./image.png")
    
    
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 18:19:10 GMT 2025
    - 4.7K bytes
    - Click Count (0)
  2. tests/test_tutorial/test_additional_responses/test_tutorial004.py

    
    def test_path_operation_img(client: TestClient):
        shutil.copy("./docs/en/docs/img/favicon.png", "./image.png")
        response = client.get("/items/foo?img=1")
        assert response.status_code == 200, response.text
        assert response.headers["Content-Type"] == "image/png"
        assert len(response.content)
        os.remove("./image.png")
    
    
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 18:19:10 GMT 2025
    - 4.9K bytes
    - Click Count (0)
  3. docs_src/additional_responses/tutorial004_py310.py

    }
    
    
    app = FastAPI()
    
    
    @app.get(
        "/items/{item_id}",
        response_model=Item,
        responses={**responses, 200: {"content": {"image/png": {}}}},
    )
    async def read_item(item_id: str, img: bool | None = None):
        if img:
            return FileResponse("image.png", media_type="image/png")
        else:
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 10 08:55:32 GMT 2025
    - 669 bytes
    - Click Count (0)
  4. docs_src/additional_responses/tutorial002_py310.py

        "/items/{item_id}",
        response_model=Item,
        responses={
            200: {
                "content": {"image/png": {}},
                "description": "Return the JSON item or an image.",
            }
        },
    )
    async def read_item(item_id: str, img: bool | None = None):
        if img:
            return FileResponse("image.png", media_type="image/png")
        else:
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 10 08:55:32 GMT 2025
    - 596 bytes
    - Click Count (0)
  5. docs/de/docs/tutorial/body-nested-models.md

    ///
    
    ## Bodys aus reinen Listen { #bodies-of-pure-lists }
    
    Wenn das äußerste Element des JSON-Bodys, das Sie erwarten, ein JSON-`array` (eine Python-`list`) ist, können Sie den Typ im Funktionsparameter deklarieren, mit der gleichen Syntax wie in Pydantic-Modellen:
    
    ```Python
    images: list[Image]
    ```
    
    so wie in:
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 7.6K bytes
    - Click Count (0)
  6. docs/es/docs/tutorial/body-nested-models.md

    Observa cómo `Offer` tiene una lista de `Item`s, que a su vez tienen una lista opcional de `Image`s
    
    ///
    
    ## Cuerpos de listas puras { #bodies-of-pure-lists }
    
    Si el valor superior del cuerpo JSON que esperas es un `array` JSON (una `list` en Python), puedes declarar el tipo en el parámetro de la función, al igual que en los modelos Pydantic:
    
    ```Python
    images: list[Image]
    ```
    
    como en:
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 7.2K bytes
    - Click Count (0)
  7. docs/en/docs/tutorial/body-nested-models.md

    ```Python
    images: list[Image]
    ```
    
    as in:
    
    {* ../../docs_src/body_nested_models/tutorial008_py39.py hl[13] *}
    
    ## Editor support everywhere { #editor-support-everywhere }
    
    And you get editor support everywhere.
    
    Even for items inside of lists:
    
    <img src="/img/tutorial/body-nested-models/image01.png">
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 6.7K bytes
    - Click Count (0)
  8. docs/ru/docs/tutorial/body-nested-models.md

    ///
    
    ## Тела с чистыми списками элементов { #bodies-of-pure-lists }
    
    Если верхний уровень значения тела JSON-объекта представляет собой JSON `array` (в Python — `list`), вы можете объявить тип в параметре функции, так же как в моделях Pydantic:
    
    ```Python
    images: list[Image]
    ```
    
    например так:
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 11.5K bytes
    - Click Count (0)
  9. docs/en/docs/advanced/additional-responses.md

    For example, you can add an additional media type of `image/png`, declaring that your *path operation* can return a JSON object (with media type `application/json`) or a PNG image:
    
    {* ../../docs_src/additional_responses/tutorial002_py310.py hl[17:22,26] *}
    
    /// note
    
    Notice that you have to return the image using a `FileResponse` directly.
    
    ///
    
    /// info
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 8.9K bytes
    - Click Count (0)
  10. docs/en/docs/css/custom.css

      top: -10px;
      right: 0;
      font-size: 0.5rem;
      color: #e6e6e6;
      background-color: #666;
      border-radius: 10px;
      padding: 0 10px;
      z-index: 10;
    }
    
    .announce-wrapper .sponsor-image {
      display: block;
      border-radius: 20px;
    }
    
    .announce-wrapper>div {
      min-height: 40px;
      display: flex;
      align-items: center;
    }
    
    .twitter {
      color: #00acee;
    }
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Fri Nov 28 15:55:15 GMT 2025
    - 3.7K bytes
    - Click Count (0)
Back to Top