The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Get Page - Request Method PUT
There are two request methods in the Get Page operator - GET and POST. Is there a way to implement also PUT method?
If I manually change either GET or POST method to PUT in XML, the process fails: <parameter key="request_method" value="PUT"/>
Thanks!
0
Best Answers
-
IngoRM Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University Professor Posts: 1,751 RM Founder
Hi,
Not with the Get Page operator which - as you saw - only support Get and Post.
But you could implement a put request with a command line tool for your OS which you invoke with the Execute Program operator.
Hope this helps,
Ingo
1 -
IngoRM Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University Professor Posts: 1,751 RM Founder
Even better - thanks for sharing!
Best,
Ingo
0
Answers
Ingo, thank you very much!
Another way is to deploy the Execute Script operator. The example below works fine.
-----------------------------------------------------------
String json = %{query_string};
String requestString = %{URL}
//send request
URL url = new URL(requestString);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
conn.setRequestMethod("PUT");
conn.setRequestProperty("Content-Type", "application/json");
OutputStream os = conn.getOutputStream();
os.write(query_string.getBytes());
os.flush();
int responseCode = conn.getResponseCode();
-----------------------------------------------------------
Pavel