Changed to close the connection explicitly for the http request.