try {
StatusLine statusLine = response.getStatusLine() ;
if ( statusLine.getStatusCode() >= 400 )
{
log.debug(format("[%d] %s %s",id, statusLine.getStatusCode(), statusLine.getReasonPhrase())) ;
throw new HttpException(statusLine.getStatusCode()+" "+statusLine.getReasonPhrase()) ;
}
String contentType = response.getFirstHeader(HttpNames.hContentType).getValue() ;
MediaType mt = new MediaType(contentType) ;
String ct = mt.getContentType() ;