Search Options

Results per page
Sort
Preferred Languages
Advance

Results 741 - 750 of 924 for docs_src (0.04 sec)

  1. tests/test_tutorial/test_schema_extra_example/test_tutorial002.py

        params=[
            pytest.param("tutorial002_py39"),
            pytest.param("tutorial002_py310", marks=needs_py310),
        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.schema_extra_example.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    def test_post_body_example(client: TestClient):
        response = client.put(
            "/items/5",
            json={
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 4.9K bytes
    - Viewed (0)
  2. scripts/playwright/header_param_models/image01.py

        page.screenshot(path="docs/en/docs/img/tutorial/header-param-models/image01.png")
    
        # ---------------------
        context.close()
        browser.close()
    
    
    process = subprocess.Popen(
        ["fastapi", "run", "docs_src/header_param_models/tutorial001.py"]
    )
    try:
        for _ in range(3):
            try:
                response = httpx.get("http://localhost:8000/docs")
            except httpx.ConnectError:
                time.sleep(1)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  3. scripts/playwright/request_form_models/image01.py

        page.screenshot(path="docs/en/docs/img/tutorial/request-form-models/image01.png")
    
        # ---------------------
        context.close()
        browser.close()
    
    
    process = subprocess.Popen(
        ["fastapi", "run", "docs_src/request_form_models/tutorial001.py"]
    )
    try:
        for _ in range(3):
            try:
                response = httpx.get("http://localhost:8000/docs")
            except httpx.ConnectError:
                time.sleep(1)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Sep 13 09:14:46 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_path_operation_configurations/test_tutorial006.py

    import pytest
    from fastapi.testclient import TestClient
    
    from docs_src.path_operation_configuration.tutorial006_py39 import app
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "path,expected_status,expected_response",
        [
            ("/items/", 200, [{"name": "Foo", "price": 42}]),
            ("/users/", 200, [{"username": "johndoe"}]),
            ("/elements/", 200, [{"item_id": "Foo"}]),
        ],
    )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 2.4K bytes
    - Viewed (0)
  5. docs/ru/docs/how-to/conditional-openapi.md

    Вы можете легко использовать те же настройки Pydantic, чтобы настроить сгенерированный OpenAPI и интерфейсы документации.
    
    Например:
    
    {* ../../docs_src/conditional_openapi/tutorial001_py39.py hl[6,11] *}
    
    Здесь мы объявляем настройку `openapi_url` с тем же значением по умолчанию — `"/openapi.json"`.
    
    Затем используем её при создании приложения FastAPI.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 4.1K bytes
    - Viewed (0)
  6. docs/zh/docs/advanced/response-change-status-code.md

    但你仍然希望能够使用`response_model`过滤和转换你返回的数据。
    
    对于这些情况,你可以使用一个`Response`参数。
    
    ## 使用 `Response` 参数
    
    你可以在你的*路径操作函数*中声明一个`Response`类型的参数(就像你可以为cookies和头部做的那样)。
    
    然后你可以在这个*临时*响应对象中设置`status_code`。
    
    {* ../../docs_src/response_change_status_code/tutorial001.py hl[1,9,12] *}
    
    然后你可以像平常一样返回任何你需要的对象(例如一个`dict`或者一个数据库模型)。如果你声明了一个`response_model`,它仍然会被用来过滤和转换你返回的对象。
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  7. docs/uk/docs/tutorial/debugging.md

    Ви можете під'єднати дебагер у Вашому редакторі коду, наприклад, у Visual Studio Code або PyCharm.
    
    ## Виклик `uvicorn`
    
    У Вашому FastAPI-додатку імпортуйте та запустіть `uvicorn` безпосередньо:
    
    {* ../../docs_src/debugging/tutorial001.py hl[1,15] *}
    
    ### Про `__name__ == "__main__"`
    
    Головна мета використання `__name__ == "__main__"` — це забезпечення виконання певного коду тільки тоді, коли файл запускається безпосередньо:
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Feb 28 14:24:45 UTC 2025
    - 3.6K bytes
    - Viewed (0)
  8. docs/fr/docs/advanced/additional-status-codes.md

    Pour y parvenir, importez `JSONResponse` et renvoyez-y directement votre contenu, en définissant le `status_code` que vous souhaitez :
    
    {* ../../docs_src/additional_status_codes/tutorial001.py hl[4,25] *}
    
    /// warning | Attention
    
    Lorsque vous renvoyez une `Response` directement, comme dans l'exemple ci-dessus, elle sera renvoyée directement.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_body/test_tutorial003.py

        params=[
            pytest.param("tutorial003_py39"),
            pytest.param("tutorial003_py310", marks=needs_py310),
        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.body.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    def test_put_all(client: TestClient):
        response = client.put(
            "/items/123",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 5.5K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_generate_clients/test_tutorial002.py

    from fastapi.testclient import TestClient
    
    from docs_src.generate_clients.tutorial002_py39 import app
    
    client = TestClient(app)
    
    
    def test_post_items():
        response = client.post("/items/", json={"name": "Foo", "price": 5})
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Item received"}
    
    
    def test_post_users():
        response = client.post(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 7.1K bytes
    - Viewed (0)
Back to top