Hi you can see some specific examples here: https://github.com/tsurdilo/process-designer/blob/master/src/main/java/com/intalio/web/server/TaskFormsServlet.java and here: https://github.com/droolsjbpm/jbpm/blob/master/jbpm-gwt/jbpm-gwt-shared/src/main/java/org/jbpm/integration/console/shared/GuvnorConnectionUtils.java
For deleting assets here is an example:
String deleteURL = ExternalInfo.getExternalProtocol(profile)
+ "://"
+ ExternalInfo.getExternalHost(profile)
+ "/"
+ profile.getExternalLoadURLSubdomain().substring(0,
profile.getExternalLoadURLSubdomain().indexOf("/"))
+ "/rest/packages/" + packageName + "/assets/" + assetName
+ assetExt;
URL deleteAssetURL = new URL(deleteURL);
HttpURLConnection deleteConnection = (HttpURLConnection) deleteAssetURL
.openConnection();
applyAuth(profile, deleteConnection);
deleteConnection.setRequestMethod("DELETE");
deleteConnection.connect();
_logger.info("delete connection response code: " + deleteConnection.getResponseCode());
If have set up authentication in Guvnor, the applyAuth method sets the Basic Authorization header with the encided username and password.
Hope this helps.