Code example for HttpEntity

Methods: getContentLength

        return combinedParams;
    public HttpEntity getEntity() throws Exception {
        // check if entity was explictly set otherwise return params as entity 
        if (entity.getContentLength() > 0) {
            return entity;
        } else if (!params.isEmpty()) {
            // construct entity if not already set 
            return new UrlEncodedFormEntity(params, DEFAULT_ENCODING);
        return null; 
    public static String base64Encode(String str) {
        byte[] bytes = str.getBytes();
        return Base64.encodeToString(bytes, Base64.NO_WRAP);
    public static Throwable getRootCause(Throwable throwable) {
Connect your IDE to all the code out there  Get Codota for Java