The Altair Community is migrating to a new platform to provide a better experience for you. The RapidMiner Community will merge with the Altair Community at the same time. In preparation for the migration, both communities are on read-only mode from July 15th - July 24th, 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.
Options

Get Page - Request Method PUT

PavelPavel Member Posts: 6 Contributor I
edited November 2018 in Help

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!

Best Answers

  • Options
    IngoRMIngoRM Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University Professor Posts: 1,751 RM Founder
    Solution Accepted

    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

  • Options
    IngoRMIngoRM Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University Professor Posts: 1,751 RM Founder
    Solution Accepted

    Even better - thanks for sharing!

    Best,

    Ingo

Answers

  • Options
    PavelPavel Member Posts: 6 Contributor I

    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

Sign In or Register to comment.