I’m using KNIME in combination with MS PowerBI and trying to publish reports from KNIME using the PowerBI REST API. Unfortunately the PATCH request is not available as a node (unlike the more regular GET, POST, PUT and DELETE). In order to update e.g. a data source for the report PowerBI uses PATCH, and I did not find a way around it with other commands.
Also tried falling back to the Java node and use an HTTPConnection, but I run into the same issue: request type is not supported.
Does anyone have suggestions how to proceed?
(any change the PATCH request node will be added to the REST-set?)
Found a work-around in Java’s HTTPURLConnection… using reflection classes to change final fields at runtime
HttpURLConnection http = (HttpURLConnection) url.openConnection(); //http.setRequestMethod(“PATCH”);
final Object target;
if (http instanceof HttpsURLConnectionImpl) {
final Field delegate = HttpsURLConnectionImpl.class.getDeclaredField("delegate");
delegate.setAccessible(true);
target = delegate.get(http);
} else {
target = http;
}
final Field f = HttpURLConnection.class.getDeclaredField("method");
f.setAccessible(true);
f.set(target, "PATCH");
Thanks for sharing your workaround. I think a PATCH Request node would be a good extension for our REST Web Services, therefore I’ve opened a feature request for a dedicated PATCH Request node.
Has there been any movement on the creation of an actual PATCH node? I would like to avoid creating any special logic. Thank you. @Marten_Pfannenschmidt