cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HTTP monitor - Post-execution script - XML format in the response

carlos_ortega
Organizer

Hi,

 

I have a HTTP Check in which I receive the response in XML format. However, I need to use that response in a post-execution script to launch a second request to other HTTP web service.

I have read that Json in the only format in which we could use the post-execution script. So, Is there any way to convert the XML response to a JSON format in the "post-execution script" that we could add in a Http monitor?.

 

Thanks

Carlos

1 REPLY 1

HannahM
Dynatrace Champion
Dynatrace Champion

Hi Carlos, 

 

you should be fine working with xml without converting it. This is a snippet I used for finding a string in an xml response:

 

var body = response.getResponseBody();
PubDateString = body.match(/<pubDate>(.*?)<\/pubDate>/g)[0];
api.info("PubDateString is : "+PubDateString);