Code example for HttpEntity

Methods: getContentType

0
    public static ContentType get( 
            final HttpEntity entity) throws ParseException, UnsupportedCharsetException {
        if (entity == null) {
            return null; 
        } 
        Header header = entity.getContentType();
        if (header != null) {
            HeaderElement[] elements = header.getElements();
            if (elements.length > 0) {
                return create(elements[0]);
            } 
        } 
        return null; 
    } 
 
    /** 
     * Extracts <code>Content-Type</code> value from {@link HttpEntity} or returns default value 
     * if not explicitly specified. 
     * 
     * @param entity HTTP entity 
Connect your IDE to all the code out there  Get Codota for Java