Skip to main content
Question

HTTPCaller - How to get a value from the response_body


plynn
Participant
Forum|alt.badge.img+3
  • Participant

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.

4 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+38

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​


plynn
Participant
Forum|alt.badge.img+3
  • Author
  • Participant
  • August 4, 2021
virtualcitymatt wrote:

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.


gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • August 4, 2021
plynn wrote:

The response is actually XML.

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


virtualcitymatt
Celebrity
Forum|alt.badge.img+38
plynn wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings