Search Options

Results per page
Sort
Preferred Languages
Advance

Results 151 - 160 of 1,916 for FastApi (0.03 sec)

  1. docs/fr/docs/advanced/index.md

    pour débutants avancés pour compléter cette section de la documentation, vous pouvez consulter : <a href="https://testdrive.io/courses/tdd-fastapi/" class="external- link" target="_blank">Développement piloté par les tests avec FastAPI et Docker</a> par **TestDriven.io**.
    
    10 % de tous les bénéfices de ce cours sont reversés au développement de **FastAPI**. 🎉 😄...
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Nov 09 16:39:20 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  2. docs_src/additional_responses/tutorial002_py39.py

    from typing import Union
    
    from fastapi import FastAPI
    from fastapi.responses import FileResponse
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        id: str
        value: str
    
    
    app = FastAPI()
    
    
    @app.get(
        "/items/{item_id}",
        response_model=Item,
        responses={
            200: {
                "content": {"image/png": {}},
                "description": "Return the JSON item or an image.",
            }
        },
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 628 bytes
    - Viewed (0)
  3. docs/en/docs/reference/responses.md

    Read more about it in the [FastAPI docs for Custom Response - HTML, Stream, File, others](https://fastapi.tiangolo.com/advanced/custom-response/).
    
    You can import them directly from `fastapi.responses`:
    
    ```python
    from fastapi.responses import (
        FileResponse,
        HTMLResponse,
        JSONResponse,
        ORJSONResponse,
        PlainTextResponse,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 3.7K bytes
    - Viewed (0)
  4. tests/test_typing_python39.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    from .utils import needs_py310
    
    
    @needs_py310
    def test_typing():
        types = {
            list[int]: [1, 2, 3],
            dict[str, list[int]]: {"a": [1, 2, 3], "b": [4, 5, 6]},
            set[int]: [1, 2, 3],  # `set` is converted to `list`
            tuple[int, ...]: [1, 2, 3],  # `tuple` is converted to `list`
        }
        for test_type, expect in types.items():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 709 bytes
    - Viewed (0)
  5. docs/zh/docs/advanced/using-request-directly.md

    并从以下对象中提取数据:
    
    * 路径参数
    * 请求头
    * Cookies
    * 等
    
    **FastAPI** 使用这种方式验证数据、转换数据,并自动生成 API 文档。
    
    但有时,我们也需要直接访问 `Request` 对象。
    
    ## `Request` 对象的细节
    
    实际上,**FastAPI** 的底层是 **Starlette**,**FastAPI** 只不过是在  **Starlette** 顶层提供了一些工具,所以能直接使用 Starlette 的  <a href="https://www.starlette.dev/requests/" class="external-link" target="_blank">`Request`</a> 对象。
    
    但直接从 `Request` 对象提取数据时(例如,读取请求体),**FastAPI** 不会验证、转换和存档数据(为 API 文档使用 OpenAPI)。
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 1.9K bytes
    - Viewed (0)
  6. tests/test_security_http_basic_optional.py

    from base64 import b64encode
    from typing import Optional
    
    from fastapi import FastAPI, Security
    from fastapi.security import HTTPBasic, HTTPBasicCredentials
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    security = HTTPBasic(auto_error=False)
    
    
    @app.get("/users/me")
    def read_current_user(credentials: Optional[HTTPBasicCredentials] = Security(security)):
        if credentials is None:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 24 19:03:06 UTC 2025
    - 2.6K bytes
    - Viewed (0)
  7. tests/test_ambiguous_params.py

    from typing import Annotated
    
    import pytest
    from fastapi import Depends, FastAPI, Path
    from fastapi.param_functions import Query
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    def test_no_annotated_defaults():
        with pytest.raises(
            AssertionError, match="Path parameters cannot have a default value"
        ):
    
            @app.get("/items/{item_id}/")
            async def get_item(item_id: Annotated[int, Path(default=1)]):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 2K bytes
    - Viewed (1)
  8. docs/ru/docs/advanced/response-cookies.md

    **FastAPI** предоставляет `fastapi.responses`, которые являются теми же объектами, что и `starlette.responses`, просто для удобства. Однако большинство доступных типов ответов поступает непосредственно из **Starlette**.
    
    И так как `Response` часто используется для установки HTTP-заголовков и cookies, **FastAPI** также предоставляет его как `fastapi.Response`.
    
    ///
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 3.6K bytes
    - Viewed (0)
  9. docs_src/additional_responses/tutorial004_py39.py

    from typing import Union
    
    from fastapi import FastAPI
    from fastapi.responses import FileResponse
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        id: str
        value: str
    
    
    responses = {
        404: {"description": "Item not found"},
        302: {"description": "The item was moved"},
        403: {"description": "Not enough privileges"},
    }
    
    
    app = FastAPI()
    
    
    @app.get(
        "/items/{item_id}",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 701 bytes
    - Viewed (0)
  10. fastapi/openapi/docs.py

        for example the URLs to use to load Swagger UI's JavaScript and CSS.
    
        Read more about it in the
        [FastAPI docs for Configure Swagger UI](https://fastapi.tiangolo.com/how-to/configure-swagger-ui/)
        and the [FastAPI docs for Custom Docs UI Static Assets (Self-Hosting)](https://fastapi.tiangolo.com/how-to/custom-docs-ui-assets/).
        """
        current_swagger_ui_parameters = swagger_ui_default_parameters.copy()
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 10.1K bytes
    - Viewed (0)
Back to top