private <T extends CCBAPIResponse> T makeRequest(final String api, final Map<String, String> params,
                                                     final String form, final Class<T> clazz)
            throws IOException {

        byte[] payload = null;
        if (form != null) {
            payload = form.getBytes(StandardCharsets.UTF_8);
        }

        final InputStream entity = httpClient.sendPostRequest(makeURI(api, params), payload);
        try {
            T response = xmlBinder.bindResponseXML(entity, clazz);
            if (response.getErrors() != null && response.getErrors().size() > 0) {
                throw new CCBErrorResponseException(response.getErrors());
            }
            return response;
        } finally {
            if (entity != null) {
                entity.close();
            }
        }
    }
private < T extends CCBAPIResponse > T makeRequest ( final String api , final Map < String , String > params , final String form , final Class < T > clazz ) throws IOException { byte [ ] payload = null ; if ( form != null ) { payload = form . getBytes ( StandardCharsets . UTF_8 ) ; } final InputStream entity = httpClient . sendPostRequest ( makeURI ( api , params ) , payload ) ; try { T response = xmlBinder . bindResponseXML ( entity , clazz ) ; if ( response . getErrors ( ) != null && response . getErrors ( ) . size ( ) > 0 ) { throw new CCBErrorResponseException ( response . getErrors ( ) ) ; } return response ; } finally { if ( entity != null ) { entity . close ( ) ; } } }
Send a request to CCB.

@param api The CCB service name.
@param params The URL query params.
@param form The form body parameters.
@param clazz The response class.
@param <T> The type of response.
@return The response.
@throws IOException if an error occurs.