+ /**
+ * Perform REST Delete.
+ *
+ * @param url the url
+ * @param username the user
+ * @param password the password
+ * @param headers any headers
+ * @return the response status code and the body
+ */
+ public Pair<Integer, String> delete(String url, String username, String password, Map<String, String> headers) {
+ var delete = new HttpDelete(url);
+ addHeaders(delete, username, password, headers);
+ return sendRequest(delete);
+ }
+
+ /**
+ * Perform REST Patch.
+ *
+ * @param url the url
+ * @param username the user
+ * @param password the password
+ * @param headers any headers
+ * @param body body to send
+ * @return the response status code and the body
+ */
+ public Pair<Integer, String> patch(String url, String username, String password, Map<String, String> headers,
+ String body) {
+ var contentType = "application/merge-patch+json";
+ var patch = new HttpPatch(url);
+ addHeaders(patch, username, password, headers);
+ patch.addHeader(CONTENT_TYPE, contentType);
+ try {
+ var input = new StringEntity(body);
+ input.setContentType(contentType);
+ patch.setEntity(input);
+ } catch (Exception e) {
+ logger.error("patch threw: ", e);
+ return null;
+ }
+ return sendRequest(patch);
+ }
+