protected HttpUriRequest setupRequestJson(final String path, final String method, final String params) {
        final HttpUriRequest request = buildMethod(method, path, params);
        request.addHeader(new BasicHeader("Accept", "application/json"));
        request.addHeader(new BasicHeader("Accept-Charset", "utf-8"));
        request.setHeader(new BasicHeader("Authorization", "Basic " + new String(Base64.encodeBase64((this.token + ":" + this.secret).getBytes()))));
        return request;
    }
protected HttpUriRequest setupRequestJson ( final String path , final String method , final String params ) { final HttpUriRequest request = buildMethod ( method , path , params ) ; request . addHeader ( new BasicHeader ( "Accept" , "application/json" ) ) ; request . addHeader ( new BasicHeader ( "Accept-Charset" , "utf-8" ) ) ; request . setHeader ( new BasicHeader ( "Authorization" , "Basic " + new String ( Base64 . encodeBase64 ( ( this . token + ":" + this . secret ) . getBytes ( ) ) ) ) ) ; return request ; }
Helper method to build the request to the server.

@param path the path.
@param method the method.
@param params the json string.
@return the request.