close

abstract fun close()

Closes the HTTP client and releases all resources.

This method should be called when the client is no longer needed to properly clean up connections, thread pools, connection pools, and other resources. After calling close(), the client should not be used anymore.

Failure to call this method may result in:

  • Resource leaks (threads, connections, memory)

  • Delayed application shutdown

  • Connection pool exhaustion

It is strongly recommended to use the client in a try-finally block or with resource management patterns to ensure proper cleanup.

Note: Once closed, attempting to use the client will result in an exception.