Function HTTPClientResponse.disconnect
Forcefully terminates the connection regardless of the current state.
void disconnect() @safe;
Note that this will only actually disconnect if the request has not yet been fully processed. If the whole body was already read, the connection is not owned by the current request operation anymore and cannot be accessed. Use a "Connection: close" header instead in this case to let the server close the connection.