sdk/java/src/main/java/com/example/www/controllers/BlacklistIPAddressesController.java
/**
     * Builds the HttpRequest object for search
     */
Builds the HttpRequest object for search
Builds the HttpRequest object for search
private HttpRequest _buildSearchRequest(
                final String searchFilter) throws IOException, APIException {
        String _baseUri = Configuration.getBaseUri();
        StringBuilder _queryBuilder = new StringBuilder(_baseUri + "/v1.1/blacklists/ipaddresses/filter/{search_filter}");
        Map<String, Object> _templateParameters = new HashMap<String, Object>();
        _templateParameters.put("search_filter", searchFilter);
        APIHelper.appendUrlWithTemplateParameters(_queryBuilder, _templateParameters);
        String _queryUrl = APIHelper.cleanUrl(_queryBuilder);
        Map<String, String> _headers = new HashMap<String, String>();
        _headers.put("user-agent", BaseController.userAgent);
        _headers.put("accept", "application/json");
        HttpRequest _request = getClientInstance().get(_queryUrl, _headers, null);
        if (getHttpCallBack() != null) {
            getHttpCallBack().OnBeforeRequest(_request);
        }
        CustomAuthUtility.appendCustomAuthParams(_request);
        return _request;
    }
private HttpRequest _buildSearchRequest ( final String searchFilter ) throws IOException , APIException { String _baseUri = Configuration . getBaseUri ( ) ; StringBuilder _queryBuilder = new StringBuilder ( _baseUri + "/v1.1/blacklists/ipaddresses/filter/{search_filter}" ) ; Map < String , Object > _templateParameters = new HashMap < String , Object > ( ) ; _templateParameters . put ( "search_filter" , searchFilter ) ; APIHelper . appendUrlWithTemplateParameters ( _queryBuilder , _templateParameters ) ; String _queryUrl = APIHelper . cleanUrl ( _queryBuilder ) ; Map < String , String > _headers = new HashMap < String , String > ( ) ; _headers . put ( "user-agent" , BaseController . userAgent ) ; _headers . put ( "accept" , "application/json" ) ; HttpRequest _request = getClientInstance ( ) . get ( _queryUrl , _headers , null ) ; if ( getHttpCallBack ( ) != null ) { getHttpCallBack ( ) . OnBeforeRequest ( _request ) ; } CustomAuthUtility . appendCustomAuthParams ( _request ) ; return _request ; }
Builds the HttpRequest object for search
Builds the HttpRequest object for search
//the base uri for api requests //prepare query string for API call //process template parameters //validate and preprocess url //load all headers for the outgoing API request //prepare and invoke the API call request to fetch the response // Invoke the callback before request if its not null // Custom Authentication to be added for authorization