title: Ideal way to close connections in RestAssured?
body: <p>I am using RestAssured for API automation. We have a huge application with so many api calls. So, what could be better way to close the connection after response has been received properly. In that way, I will not be worried about connection leakage.</p>
  
  <p>Below is my code:</p>
  
  <pre><code>RestAssuredConfig restAssuredConfig = RestAssured.config().encoderConfig(EncoderConfig.encoderConfig().appendDefaultContentCharsetToContentTypeIfUndefined(false)).httpClient(HttpClientConfig.httpClientConfig().setParam("http.connection.timeout", 60000).setParam("http.socket.timeout", 300000).setParam("http.conn-manager.timeout", 300000));
  
  RequestSpecification requestSpecification = RestAssured.given().config(restAssuredConfig).relaxedHTTPSValidation();
  </code></pre>
  
  <p>Should I specify ConnectionConfig like below ?</p>
  
  <pre><code>RestAssured.config().connectionConfig(ConnectionConfig.connectionConfig().closeIdleConnectionsAfterEachResponse());
  </code></pre>
  
  <p>Should I use closeIdleConnectionsAfterEachResponse() method ? or closeIdleConnectionsAfterEachResponseAfter(long idleTime, TimeUnit timeUnit) method ?</p>
  
  <p>Please help. Thanks in advance.</p>