EntityUtils.consumeQuietly(response.getEntity());
String allow = null;
Header[] allHeaders = response.getAllHeaders();
for (int i = 0; i < allHeaders.length; i++)
if (allHeaders[i].getName() == "Allow") allow = allHeaders[i].getValue();
if (allow == null) throw new BadRequestException(404,"Method options not supported.");
return allow.split(",");
}