Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1761 - 1770 of 2,000 for Fastapi (0.06 sec)

  1. tests/test_tutorial/test_body_fields/test_tutorial001.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.body_fields.tutorial001 import app
    
        client = TestClient(app)
        return client
    
    
    def test_items_5(client: TestClient):
        response = client.put("/items/5", json={"item": {"name": "Foo", "price": 3.0}})
        assert response.status_code == 200
        assert response.json() == {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_body_fields/test_tutorial001_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_fields.tutorial001_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_items_5(client: TestClient):
        response = client.put("/items/5", json={"item": {"name": "Foo", "price": 3.0}})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_cookie_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_py310", marks=needs_py310),
            "tutorial001_an",
            pytest.param("tutorial001_an_py39", marks=needs_py39),
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_request_form_models/test_tutorial002_pv1_an.py

    import pytest
    from fastapi.testclient import TestClient
    
    from tests.utils import needs_pydanticv1
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.request_form_models.tutorial002_pv1_an import app
    
        client = TestClient(app)
        return client
    
    
    # TODO: remove when deprecating Pydantic v1
    @needs_pydanticv1
    def test_post_body_form(client: TestClient):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Sep 06 17:31:18 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_request_files/test_tutorial001_02_py310.py

    from pathlib import Path
    
    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.request_files.tutorial001_02_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_post_form_no_body(client: TestClient):
        response = client.post("/files/")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 8.5K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_websockets/test_tutorial002.py

    import pytest
    from fastapi.testclient import TestClient
    from fastapi.websockets import WebSocketDisconnect
    
    from docs_src.websockets.tutorial002 import app
    
    
    def test_main():
        client = TestClient(app)
        response = client.get("/")
        assert response.status_code == 200, response.text
        assert b"<!DOCTYPE html>" in response.content
    
    
    def test_websocket_with_cookie():
        client = TestClient(app, cookies={"session": "fakesession"})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Nov 13 14:26:09 UTC 2022
    - 3.6K bytes
    - Viewed (0)
  7. docs/de/docs/deployment/manually.md

    # Einen Server manuell ausführen – Uvicorn
    
    Das Wichtigste, was Sie zum Ausführen einer **FastAPI**-Anwendung auf einer entfernten Servermaschine benötigen, ist ein ASGI-Serverprogramm, wie **Uvicorn**.
    
    Es gibt 3 Hauptalternativen:
    
    * <a href="https://www.uvicorn.org/" class="external-link" target="_blank">Uvicorn</a>: ein hochperformanter ASGI-Server.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Aug 06 04:48:30 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  8. docs/pt/docs/tutorial/query-params.md

    {!> ../../docs_src/query_params/tutorial002.py!}
    ```
    
    ////
    
    Nesse caso, o parâmetro da função `q` será opcional, e `None` será o padrão.
    
    /// check | "Verificar"
    
    Você também pode notar que o **FastAPI** é esperto o suficiente para perceber que o parâmetro da rota `item_id` é um parâmetro da rota, e `q` não é, portanto, `q` é o parâmetro de consulta.
    
    ///
    
    ## Conversão dos tipos de parâmetros de consulta
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  9. docs/zh/docs/advanced/openapi-callbacks.md

    API 的用户 (外部开发者)要在您的 API 内使用 POST 请求创建一条发票记录。
    
    (假设)您的 API 将:
    
    * 把发票发送至外部开发者的消费者
    * 归集现金
    * 把通知发送至 API 的用户(外部开发者)
        * 通过(从您的 API)发送 POST 请求至外部 API (即**回调**)来完成
    
    ## 常规 **FastAPI** 应用
    
    添加回调前,首先看下常规 API 应用是什么样子。
    
    常规 API 应用包含接收 `Invoice` 请求体的*路径操作*,还有包含回调 URL 的查询参数 `callback_url`。
    
    这部分代码很常规,您对绝大多数代码应该都比较熟悉了:
    
    ```Python hl_lines="10-14  37-54"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  10. docs/em/docs/tutorial/request-forms-and-files.md

    &amp; 👆 💪 📣 📁 `bytes` &amp; `UploadFile`.
    
    /// warning
    
    👆 💪 📣 💗 `File` &amp; `Form` 🔢 *➡ 🛠️*, ✋️ 👆 💪 🚫 📣 `Body` 🏑 👈 👆 ⌛ 📨 🎻, 📨 🔜 ✔️ 💪 🗜 ⚙️ `multipart/form-data` ↩️ `application/json`.
    
    👉 🚫 🚫 **FastAPI**, ⚫️ 🍕 🇺🇸🔍 🛠️.
    
    ///
    
    ## 🌃
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.1K bytes
    - Viewed (0)
Back to top