Mint.HTTP.recv

You're seeing just the function recv, go back to Mint.HTTP module for more information.
Link to this function

recv(conn, byte_count, timeout)

View Source

Specs

recv(t(), non_neg_integer(), timeout()) ::
  {:ok, t(), [Mint.Types.response()]}
  | {:error, t(), Mint.Types.error(), [Mint.Types.response()]}

Receives data from the socket in a blocking way.

By default Mint operates in active mode, meaning that messages are delivered to the process that started the connection. However, Mint also supports passive mode (see the "Mode" section in the module documentation).

In passive mode, you'll need to manually get bytes out of the socket. You can do that with this function.

byte_count is the number of bytes you want out of the socket. If byte_count is 0, all available bytes will be returned.

timeout is the maximum time to wait before returning an error.

This function will raise an error if the socket is in active mode.

Examples

{:ok, conn, responses} = Mint.HTTP.recv(conn, 0, 5000)