The official client.CloseIdleConnections() function is to close idle connections without affecting the connections in use.
The function of client.CloseConns() is to close all connections, wait for the connection in use and then close it.
client.ForceCloseConns() will force close all connections immediately, even if it is in use
The function of response.CloseBody() is to close the body. For streaming requests, the connection will be closed at the same time, such as: websocket, sse, stream=true
The function of response.CloseConn() is to close the connection. For the connection in use, wait for it to be closed after completion.
The function of response.ForceCloseConns() is to forcefully close the connection. The connection will be closed immediately even if it is in use.
The official client.CloseIdleConnections() function is to close idle connections without affecting the connections in use. The function of client.CloseConns() is to close all connections, wait for the connection in use and then close it. client.ForceCloseConns() will force close all connections immediately, even if it is in use
The function of response.CloseBody() is to close the body. For streaming requests, the connection will be closed at the same time, such as: websocket, sse, stream=true The function of response.CloseConn() is to close the connection. For the connection in use, wait for it to be closed after completion. The function of response.ForceCloseConns() is to forcefully close the connection. The connection will be closed immediately even if it is in use.