Mint.WebSocket.stream_request_body
You're seeing just the function
stream_request_body
, go back to Mint.WebSocket module for more information.
Specs
stream_request_body( Mint.HTTP.t(), Mint.Types.request_ref(), iodata() | :eof | {:eof, trailing_headers :: Mint.Types.headers()} ) :: {:ok, Mint.HTTP.t()} | {:error, Mint.HTTP.t(), error()}
Streams chunks of data on the connection
stream_request_body/3
should be used to send encoded data on an
established WebSocket connection that has already been upgraded with
upgrade/5
.
This function is a wrapper around Mint.HTTP.stream_request_body/3
. It
delegates to that function unless the request_ref
belongs to an HTTP/1
WebSocket connection. When the request is an HTTP/1 WebSocket, this
function allows sending data on a request which Mint considers to be
closed, but is actually a valid WebSocket connection.
See the Mint.HTTP.stream_request_body/3
documentation for more
information.
Examples
{:ok, websocket, data} = Mint.WebSocket.encode(websocket, {:text, "hello world!"})
{:ok, conn} = Mint.WebSocket.stream_request_body(conn, websocket_ref, data)