   end
 
   defp request(method, scheme, host, port, path, headers, body, opts) when is_function(body) do
-    with {:ok, conn} <- HTTP.connect(String.to_atom(scheme), host, port),
+    with {:ok, conn} <- HTTP.connect(String.to_atom(scheme), host, port, opts),
          # FIXME Stream function in Mint will not append the content length after eof
          # This will trigger the failure in unit test
          {:ok, body, length} <- stream_request(body),
-         {:ok, conn, req_ref} <- HTTP.request(conn, method, path || "/", headers ++ [{"content-length", "#{length}"}], body),
-         {:ok, _conn, res = %{status: status, headers: headers}} <- stream_response(conn)
-    do
+         {:ok, conn, _req_ref} <-
+           HTTP.request(
+             conn,
+             method,
+             path || "/",
+             headers ++ [{"content-length", "#{length}"}],
+             body
+           ),
+         {:ok, _conn, res = %{status: status, headers: headers}} <- stream_response(conn) do
       {:ok, status, headers, Map.get(res, :data)}
     end
   end
 
   defp request(method, scheme, host, port, path, headers, body, opts) do
-    with {:ok, conn} <- HTTP.connect(String.to_atom(scheme), host, port),
+    with {:ok, conn} <- HTTP.connect(String.to_atom(scheme), host, port, opts),
          {:ok, conn, _req_ref} <- HTTP.request(conn, method, path || "/", headers, body || ""),
          {:ok, _conn, res = %{status: status, headers: headers}} <- stream_response(conn) do
       {:ok, status, headers, Map.get(res, :data)}


                  {:done, _req_ref} ->
                    Map.put(acc, :done, true)
                end
              end)

            if Map.get(response, :done) do
              response = Map.drop(response, [:done])
              {:ok, conn, response}
            else
              stream_response(conn, response)
            end

          _ ->
            {:error, "TODO: Error Handle"}
        end
    end
  end

    case next_chunk(fun) do
      {:ok, item, fun} when is_list(item) ->
        stream_request(fun, body <> List.to_string(item))

      {:ok, item, fun} ->
        stream_request(fun, body <> item)

      :eof ->
        {:ok, body, byte_size(body)}
    end
  end

