responseParser.checkStatus(response, NO_CONTENT.getStatusCode());
}
private static Client createClient(PlatformParameters platformParameters) {
DefaultApacheHttpClientConfig config = new DefaultApacheHttpClientConfig();
if (hasText(platformParameters.getProxyHost()) && (platformParameters.getProxyPort() > 0)) {
config.getProperties().put(ApacheHttpClientConfig.PROPERTY_PROXY_URI,
"http://" + platformParameters.getProxyHost() + ":" + platformParameters.getProxyPort());
if (hasText(platformParameters.getProxyUserId()) && hasText(platformParameters.getProxyPassword())) {
config.getState().setProxyCredentials(null, platformParameters.getProxyHost(),
platformParameters.getProxyPort(), platformParameters.getProxyUserId(),
platformParameters.getProxyPassword());
}
}
for (Class<?> c : PROVIDERS_CLASSES) {
config.getClasses().add(c);
}
config.getProperties().put(ApacheHttpClientConfig.PROPERTY_READ_TIMEOUT, READ_TIMEOUT_IN_MILLIS);
Client client = ApacheHttpClient.create(config);
client.setFollowRedirects(true);
client.addFilter(new HTTPBasicAuthFilter(platformParameters.getPrincipal(), platformParameters.getPassword()));