customizeConnection(httpUrlConnection);
customizeConnection(httpUrlConnection);
customizeConnection(httpUrlConnection);
private Response execute(String url, HttpMethod httpMethod) throws IOException { HTTP_LOGGER.debug("Making a {} request to {}", httpMethod.name(), url); HttpURLConnection httpUrlConnection = null; try { httpUrlConnection = openConnection(new URL(url)); httpUrlConnection.setReadTimeout(DEFAULT_READ_TIMEOUT_IN_MS); httpUrlConnection.setUseCaches(false); httpUrlConnection.setRequestMethod(httpMethod.name()); // Allow subclasses to customize the connection if they'd like to - set // their own headers, timeouts, etc. customizeConnection(httpUrlConnection); httpUrlConnection.connect(); HTTP_LOGGER.trace("Response headers: {}", httpUrlConnection.getHeaderFields()); fillHeaderAndDebugInfo(httpUrlConnection); Response response = fetchResponse(httpUrlConnection); HTTP_LOGGER.debug("Facebook responded with {}", response); return response; } finally { closeQuietly(httpUrlConnection); } }