Skip to main content

I am using the HTTPCaller transformer to perform a GET. How do I take the response and pull out specific attributes and their values?

 

For example, I pass in a list of 5 asset numbers to the HTTPCaller. It performs the GET to return all associated information for each of those assets. I need to pull out, from the response body, only the assetnum and status.

It depends on the response. The response is probably JSON. In this case you need use the json tools to extract the data.

​Have a read of this article: https://community.safe.com/s/article/json-transformations

There should be some helpful tips​


It depends on the response. The response is probably JSON. In this case you need use the json tools to extract the data.

​Have a read of this article: https://community.safe.com/s/article/json-transformations

There should be some helpful tips​

The response is actually XML.


The response is actually XML.

There are a number of ways to do this but the XMLFlattener is probably the easiest to use.


The response is actually XML.

Yep, XMLFlatterner is probably the way to go. You might need to experiment with the settings a little to get the result you want. Check out the documentation of the transformer for help


Reply