Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
PRIYABOSCH
Contributor
Contributor

TRESTCLIENT - How to PASS values to TrestClient Client

Dear Experts,

 

I am very new to Talend. I am working on a task where I have to load the data from oracle database to rest interface. I have designed my job like below. I have to load the data from database as the nested JSON structure into REST interface. I have designed my job like below.

0683p000009M61E.png

in the input schema I have mapped the output from twritejsonfield component. The data should be passed in the below format.

Key: “testKey”, Value: { "name": "testUser" } 😞

curl -X POST -H "Content-Type: application/vnd.kafka.json.v2+json" --data "{ \"records\" : [ { \"key\": \"testKey\", \"value\": { \"name\": \"testUser\" } } ] }"

 

I am not sure where to accommodate this format in the trestclient component.

 

The below is working fine in trest component.

0683p000009M67V.png

Please help on how to pass my json data to rest via the Trestclient or Trest components in the above format.

 

Thank you!

Regards,

Priya

 

Labels (5)
2 Replies
nfz11
Creator III
Creator III

tRestClient will read the POST body from a variable called 'string'.  In the incoming row, have your body in a schema variable called 'string' and make sure your input schema for the tRestClient has the one variable 'string' in it.

navnath
Contributor II
Contributor II

hello, Priya ,

 

 

I need to create new data by using a POST method in talend , i have JSON input and authentication as a barrier token. my question is that by using tREST component how to do that?

pls help me

 

 

thank you