Search code examples
pentahokettlepentaho-spoon

How to pass parameters in post call in pentaho-spoon?


I have made an api and I want to access a post call in it. I made the following transformation in kettle: enter image description here

with a params field in Generate Rows step as:

enter image description here

and REST Client step configuration as:

enter image description here

but I am unable to get any of the parameters in my post call on server side. If I write a simple post call in python as:

import requests

url = "http://10.131.70.73:5000/searchByLatest"

payload = {'search_query': 'donald trump', 'till_date': 'Tuesday, 7 June 2016 at 10:40'}

r = requests.post(url, params=payload)
print(r.text)
print(r.status_code)

I am able to get the parameters by request.args.get("search_query") on the client side in Flask. How can I make an equivalent POST call in kettle?


Solution

  • I found the solution myself eventually. Describe the fields in generate rows as:

    enter image description here

    and in the parameters tab in REST Client step, we should get the same fields:

    enter image description here

    Works perfect!