Send input files in request body

vipul_kumarvipul_kumar Member Posts: 20 Contributor I
edited December 2018 in Help

Hi,

 

I have created a RM process whose first operator is "Process Documents from Files" with its text directory parameter pointing to a directory which contains all the input files eg :/home/sample/RM/input/

 

The process works fine and takes all the files under the above location as input.
Now my requirement has changed a bit and I want to give all the file as inputs in the request body of the Webservice exposed for the process.
So I have exposed the Process as Web service through RM server. I want to do a post call to the service with body of the request having the actual files.

Tagged:

Answers

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,761 Unicorn

    I deleted the duplicate post. 

     

    I think you might have to use the Get Page(s) operator from the Web Mining extension. It has the option of POST and GET and work that into your web service. 

  • vipul_kumarvipul_kumar Member Posts: 20 Contributor I

    Hi

     

    I installed web mining extension and able to see the get page operator. 

    The getpage operator has a parameter called "url" . I dont know what to enter for this. I will again just summarize.

    I have a process of which I have exposed a web service as this http://localhost:8080/api/rest/process/classify_document_poc_1

    Now when I call this api ,the process runs and pick the input files as configured in the "Process Documents from file".
    Now I dont want to use that operator . Instead, I will call the above API with a post request and in the request only it will have the actual multipart file objects.

    Get page operator makes sense..but I dont know what to give for "url" parameter.

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,761 Unicorn

    Hmm, maybe @Edin_Klapic might have some insight on how to do this.

  • Edin_KlapicEdin_Klapic Moderator, Employee, RMResearcher, Member Posts: 299 RM Data Scientist

    Hi Vipul,

     

    did you check http://community.rapidminer.com/t5/RapidMiner-Server-Knowledge-Base/Upload-file-using-a-Rapidminer-Server-Web-App/ta-p/34989?

     

    This page describes a way how to upload files with RapidMiner Web Apps. This is done by HTML forms with input type="file". There are example processes attached including the webservice for processing the data.

    It should help you to find a solution.

     

    Best,

    Edin

     

Sign In or Register to comment.