Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 154 for Websockets (0.31 sec)

  1. docs/zh/docs/advanced/testing-websockets.md

    # 测试 WebSockets
    
    测试 WebSockets 也使用 `TestClient`。
    
    为此,要在 `with` 语句中使用 `TestClient` 连接 WebSocket。
    
    ```Python hl_lines="27-31"
    {!../../docs_src/app_testing/tutorial002.py!}
    ```
    
    /// note | "笔记"
    
    更多细节详见 <a href="https://www.starlette.io/testclient/#testing-websocket-sessions" class="external-link" target="_blank">Starlette 官档 - 测试 WebSockets</a>。
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 418 bytes
    - Viewed (0)
  2. docs/en/docs/advanced/testing-websockets.md

    # Testing WebSockets
    
    You can use the same `TestClient` to test WebSockets.
    
    For this, you use the `TestClient` in a `with` statement, connecting to the WebSocket:
    
    ```Python hl_lines="27-31"
    {!../../docs_src/app_testing/tutorial002.py!}
    ```
    
    /// note
    
    For more details, check Starlette's documentation for <a href="https://www.starlette.io/testclient/#testing-websocket-sessions" class="external-link" target="_blank">testing WebSockets</a>.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 448 bytes
    - Viewed (0)
  3. docs/de/docs/advanced/testing-websockets.md

    # WebSockets testen
    
    Sie können den schon bekannten `TestClient` zum Testen von WebSockets verwenden.
    
    Dazu verwenden Sie den `TestClient` in einer `with`-Anweisung, eine Verbindung zum WebSocket herstellend:
    
    ```Python hl_lines="27-31"
    {!../../docs_src/app_testing/tutorial002.py!}
    ```
    
    /// note | "Hinweis"
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 523 bytes
    - Viewed (0)
  4. docs/em/docs/advanced/testing-websockets.md

    👉, 👆 ⚙️ `TestClient` `with` 📄, 🔗*️⃣:
    
    ```Python hl_lines="27-31"
    {!../../docs_src/app_testing/tutorial002.py!}
    ```
    
    /// note
    
    🌅 ℹ, ✅ 💃 🧾 <a href="https://www.starlette.io/testclient/#testing-websocket-sessions" class="external-link" target="_blank">🔬 *️⃣ </a>.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 371 bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/internal/ws/WebSocketHttpTest.kt

                webSockets.add(client.newWebSocket(request, clientListener))
                attempts.countDown()
              }
            }
          }
        clientListener.setNextEventDelegate(reconnectOnFailure)
        webSockets.add(client.newWebSocket(request, clientListener))
        attempts.await()
        synchronized(webSockets) {
          for (webSocket in webSockets) {
            webSocket.cancel()
          }
        }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Mar 31 17:16:15 UTC 2024
    - 35.2K bytes
    - Viewed (0)
  6. fastapi/__init__.py

    from .param_functions import Security as Security
    from .requests import Request as Request
    from .responses import Response as Response
    from .routing import APIRouter as APIRouter
    from .websockets import WebSocket as WebSocket
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 21:51:55 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_websockets/test_tutorial001.py

                message = "Message one"
                websocket.send_text(message)
                data = websocket.receive_text()
                assert data == f"Message text was: {message}"
                message = "Message two"
                websocket.send_text(message)
                data = websocket.receive_text()
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 10 09:08:19 UTC 2020
    - 822 bytes
    - Viewed (0)
  8. tests/test_tutorial/test_websockets/test_tutorial002_an.py

                message = "Message one"
                websocket.send_text(message)
                data = websocket.receive_text()
                assert data == "Session cookie or query token value is: some-token"
                data = websocket.receive_text()
                assert data == f"Message text was: {message}, for item ID: bar"
                message = "Message two"
                websocket.send_text(message)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  9. docs/en/docs/reference/httpconnection.md

    # `HTTPConnection` class
    
    When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a `Request` or a `WebSocket`.
    
    You can import it from `fastapi.requests`:
    
    ```python
    from fastapi.requests import HTTPConnection
    ```
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 359 bytes
    - Viewed (0)
  10. tests/test_tutorial/test_websockets/test_tutorial002_an_py310.py

                message = "Message one"
                websocket.send_text(message)
                data = websocket.receive_text()
                assert data == "Session cookie or query token value is: some-token"
                data = websocket.receive_text()
                assert data == f"Message text was: {message}, for item ID: bar"
                message = "Message two"
                websocket.send_text(message)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 3.9K bytes
    - Viewed (0)
Back to top