Code example for HttpEntity

Methods: getContentType

0
        return httpResponse.getStatusLine().getStatusCode();
    } 
     
    public static String getContentType(HttpEntity entity)
    { 
        Header header = entity.getContentType();
        return header != null ? header.getElements()[0].getName() : null;
    } 
     
    public static long getContentLength(HttpEntity entity)
    { 
        return entity.getContentLength();
    } 
     
    // -------------------------------------------------------------------------------------------- 
 
    /** 
     * Creates the RestClient singleton instance if necessary. 
     * 
     * @param host 
     * @param httpPort