http client using the try-with-resources