Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1591 - 1600 of 2,000 for Fastapi (0.05 sec)

  1. tests/test_tutorial/test_response_cookies/test_tutorial002.py

    from fastapi.testclient import TestClient
    
    from docs_src.response_cookies.tutorial002 import app
    
    client = TestClient(app)
    
    
    def test_path_operation():
        response = client.post("/cookie-and-object/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Come to the dark side, we have cookies"}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Jul 09 18:06:12 UTC 2020
    - 414 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_testing/test_tutorial001.py

    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/": {
                    "get": {
                        "responses": {
                            "200": {
                                "description": "Successful Response",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 821 bytes
    - Viewed (0)
  3. docs/zh/docs/tutorial/response-model.md

    {!> ../../docs_src/response_model/tutorial003.py!}
    ```
    
    ////
    
    因此,**FastAPI** 将会负责过滤掉未在输出模型中声明的所有数据(使用 Pydantic)。
    
    ## 在文档中查看
    
    当你查看自动化文档时,你可以检查输入模型和输出模型是否都具有自己的 JSON Schema:
    
    <img src="https://fastapi.tiangolo.com/img/tutorial/response-model/image01.png">
    
    并且两种模型都将在交互式 API 文档中使用:
    
    <img src="https://fastapi.tiangolo.com/img/tutorial/response-model/image02.png">
    
    ## 响应模型编码参数
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_conditional_openapi/test_tutorial001.py

    import importlib
    
    from fastapi.testclient import TestClient
    
    from ...utils import needs_pydanticv2
    
    
    def get_client() -> TestClient:
        from docs_src.conditional_openapi import tutorial001
    
        importlib.reload(tutorial001)
    
        client = TestClient(tutorial001.app)
        return client
    
    
    @needs_pydanticv2
    def test_disable_openapi(monkeypatch):
        monkeypatch.setenv("OPENAPI_URL", "")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_wsgi/test_tutorial001.py

    from fastapi.testclient import TestClient
    
    from docs_src.wsgi.tutorial001 import app
    
    client = TestClient(app)
    
    
    def test_flask():
        response = client.get("/v1/")
        assert response.status_code == 200, response.text
        assert response.text == "Hello, World from Flask!"
    
    
    def test_app():
        response = client.get("/v2")
        assert response.status_code == 200, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Jul 09 18:06:12 UTC 2020
    - 436 bytes
    - Viewed (0)
  6. docs/de/docs/deployment/concepts.md

    ### Kleine Fehler automatisch handhaben
    
    Wenn beim Erstellen von Web-APIs mit FastAPI ein Fehler in unserem Code auftritt, wird FastAPI ihn normalerweise dem einzelnen Request zurückgeben, der den Fehler ausgelöst hat. 🛡
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Aug 06 04:48:30 UTC 2024
    - 20.6K bytes
    - Viewed (0)
  7. docs/fa/docs/tutorial/middleware.md

    # میان‌افزار - middleware
    
    شما میتوانید میان‌افزارها را در **FastAPI** اضافه کنید.
    
    "میان‌افزار" یک تابع است که با هر درخواست(request) قبل از پردازش توسط هر path operation (عملیات مسیر) خاص کار می‌کند. همچنین با هر پاسخ(response) قبل از بازگشت آن نیز کار می‌کند.
    
    * هر **درخواستی (request)** که به برنامه شما می آید را می گیرد.
    * سپس می تواند کاری برای آن **درخواست** انجام دهید یا هر کد مورد نیازتان را اجرا کنید.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_body_multiple_params/test_tutorial003_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.body_multiple_params.tutorial003_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_post_body_valid(client: TestClient):
        response = client.put(
            "/items/5",
            json={
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_header_param_models/test_tutorial002.py

    import importlib
    
    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    from tests.utils import needs_py39, needs_py310, needs_pydanticv1, needs_pydanticv2
    
    
    @pytest.fixture(
        name="client",
        params=[
            pytest.param("tutorial002", marks=needs_pydanticv2),
            pytest.param("tutorial002_py310", marks=[needs_py310, needs_pydanticv2]),
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_query_param_models/test_tutorial001.py

    import importlib
    
    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    from tests.utils import needs_py39, needs_py310
    
    
    @pytest.fixture(
        name="client",
        params=[
            "tutorial001",
            pytest.param("tutorial001_py39", marks=needs_py39),
            pytest.param("tutorial001_py310", marks=needs_py310),
            "tutorial001_an",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 9.2K bytes
    - Viewed (0)
Back to top