} catch (RuntimeException ex) {
// In case of an unexpected exception you may want to abort
// the HTTP request in order to shut down the underlying
// connection and release it back to the connection manager.
httpRequest.abort();
throw ex;
} finally {
// Closing the input stream will trigger connection release