Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 162 for websocket (0.14 sec)

  1. okhttp/src/main/kotlin/okhttp3/WebSocket.kt

     * limitations under the License.
     */
    package okhttp3
    
    import okio.ByteString
    
    /**
     * A non-blocking interface to a web socket. Use the [factory][WebSocket.Factory] to create
     * instances; usually this is [OkHttpClient].
     *
     * ## Web Socket Lifecycle
     *
     * Upon normal operation each web socket progresses through a sequence of states:
     *
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  2. docs/en/docs/advanced/websockets.md

    **FastAPI** provides the same `WebSocket` directly just as a convenience for you, the developer. But it comes directly from Starlette.
    
    ///
    
    ## Await for messages and send messages
    
    In your WebSocket route you can `await` for messages and send messages.
    
    ```Python hl_lines="48-52"
    {!../../docs_src/websockets/tutorial001.py!}
    ```
    
    You can receive and send binary, text, and JSON data.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  3. docs/de/docs/advanced/websockets.md

    # WebSockets
    
    Sie können <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API" class="external-link" target="_blank">WebSockets</a> mit **FastAPI** verwenden.
    
    ## `WebSockets` installieren
    
    Zuerst müssen Sie `WebSockets` installieren:
    
    <div class="termy">
    
    ```console
    $ pip install websockets
    
    ---> 100%
    ```
    
    </div>
    
    ## WebSockets-Client
    
    ### In Produktion
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6.9K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_websockets/test_tutorial002.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: Sun Nov 13 14:26:09 UTC 2022
    - 3.6K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_websockets/test_tutorial002_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)
  6. docs/pt/docs/advanced/websockets.md

    ```Python hl_lines="2  6-38  41-43"
    {!../../docs_src/websockets/tutorial001.py!}
    ```
    
    ## Criando um `websocket`
    
    Em sua aplicação **FastAPI**, crie um `websocket`:
    
    {*../../docs_src/websockets/tutorial001.py hl[46:47]*}
    
    /// note | Detalhes Técnicos
    
    Você também poderia usar `from starlette.websockets import WebSocket`.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Oct 31 12:20:59 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  7. docs/en/docs/reference/websockets.md

    # WebSockets
    
    When defining WebSockets, you normally declare a parameter of type `WebSocket` and with it you can read data from the client and send data to it.
    
    It is provided directly by Starlette, but you can import it from `fastapi`:
    
    ```python
    from fastapi import WebSocket
    ```
    
    /// tip
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Aug 06 04:48:30 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  8. docs/ja/docs/advanced/websockets.md

    **FastAPI** アプリケーションで、`websocket` を作成します。
    
    ```Python hl_lines="1  46-47"
    {!../../docs_src/websockets/tutorial001.py!}
    ```
    
    /// note | "技術詳細"
    
    `from starlette.websockets import WebSocket` を使用しても構いません.
    
    **FastAPI** は開発者の利便性のために、同じ `WebSocket` を提供します。しかし、こちらはStarletteから直接提供されるものです。
    
    ///
    
    ## メッセージの送受信
    
    WebSocketルートでは、 `await` を使ってメッセージの送受信ができます。
    
    ```Python hl_lines="48-52"
    {!../../docs_src/websockets/tutorial001.py!}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  9. docs/zh/docs/advanced/websockets.md

    # WebSockets
    
    您可以在 **FastAPI** 中使用 [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)。
    
    ## 安装 `WebSockets`
    
    首先,您需要安装 `WebSockets`:
    
    ```console
    $ pip install websockets
    
    ---> 100%
    ```
    
    ## WebSockets 客户端
    
    ### 在生产环境中
    
    在您的生产系统中,您可能使用现代框架(如React、Vue.js或Angular)创建了一个前端。
    
    要使用 WebSockets 与后端进行通信,您可能会使用前端的工具。
    
    或者,您可能有一个原生移动应用程序,直接使用原生代码与 WebSocket 后端通信。
    
    或者,您可能有其他与 WebSocket 终端通信的方式。
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  10. fastapi/exceptions.py

        from fastapi import (
            Cookie,
            FastAPI,
            WebSocket,
            WebSocketException,
            status,
        )
    
        app = FastAPI()
    
        @app.websocket("/items/{item_id}/ws")
        async def websocket_endpoint(
            *,
            websocket: WebSocket,
            session: Annotated[str | None, Cookie()] = None,
            item_id: str,
        ):
            if session is None:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Apr 02 02:48:51 UTC 2024
    - 4.9K bytes
    - Viewed (0)
Back to top