Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
dan-rosen
Contributor II
Contributor II

Making a series of POST requests

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!

Labels (4)
2 Replies
Anonymous
Not applicable

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

dan-rosen
Contributor II
Contributor II
Author

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