Mint.HTTP2.cancel_request

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

cancel_request(conn, request_ref)

View Source

Specs

cancel_request(t(), Mint.Types.request_ref()) ::
  {:ok, t()} | {:error, t(), Mint.Types.error()}

Cancels an in-flight request.

This function is HTTP/2 specific. It cancels an in-flight request. The server could have already sent responses for the request you want to cancel: those responses will be parsed by the connection but not returned to the user. No more responses to a request will be returned after you call cancel_request/2 on that request.

If there's no error in canceling the request, {:ok, conn} is returned where conn is the updated connection. If there's an error, {:error, conn, reason} is returned where conn is the updated connection and reason is the error reason.

Examples

{:ok, conn, ref} = Mint.HTTP2.request(conn, "GET", "/", _headers = [])
{:ok, conn} = Mint.HTTP2.cancel_request(conn, ref)