{
put.addHeader(HttpHeaders.CONTENT_TYPE, HTTP.DEF_CONTENT_CHARSET.name());
}
try
{
this.execute(put, new VoidResponseHandler());
}
catch (HttpResponseException e)
{
if (e.getStatusCode() == HttpStatus.SC_EXPECTATION_FAILED)
{
// Retry with the Expect header removed
put.removeHeaders(HTTP.EXPECT_DIRECTIVE);
if (entity.isRepeatable())
{
this.execute(put, new VoidResponseHandler());
return;
}
}
throw e;
}