Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Does anyone know how I can make a series of post requests with dynamic content?
I have JSON data in which each node has the key value pairs that would become the body of the request. How can I dynamically make these requests in a REST component? I imagine it's something like, iterate over the data and use global variables, but I'm unclear how to get the body data syntax into a Talend component.
Thanks!
Extract each key value pairs from the Json data, and then iterate each key value pairs and pass them to the rest request. How the Json data come from?
Assuming the data are read from a Json file, the job looks like:
tFileInputJson--main(row1)--tFlowToiterate--iterate--tRest
In the http body of tRest, you can access the current key value pairs like:
"bababa"+(String)globalMap.get("row1.columnName)+"bababa"
Please try and let me know if you have any questions.
Regards
Shong
Thanks Shong, can you show the syntax you would use (maybe a screenshot of the component) to put the JSON in the body. I haven't had much luck with dropping the standard {"key1":"value1", "key2":"value2"} into the box