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

**URL:** <https://community.dynatrace.com/t/http-monitor-post-execution-script-xml-format-in-the-response/34670>\
**Category:** Synthetic Monitoring\
**Tags:** http-monitor\
**Created:** [March 30, 2022, 2:09pm UTC](https://community.dynatrace.com/t/http-monitor-post-execution-script-xml-format-in-the-response/34670 "2022-03-30T14:09:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlos\_ortega](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@carlos\_ortega](https://community.dynatrace.com/u/carlos_ortega)\
**Post date:** [March 30, 2022, 2:09pm UTC](https://community.dynatrace.com/t/http-monitor-post-execution-script-xml-format-in-the-response/34670/1 "2022-03-30T14:09:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hannahmac](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/hannahmac/32/41823_2.png) [@hannahmac](https://community.dynatrace.com/u/hannahmac)\
**Post date:** [March 30, 2022, 3:46pm UTC](https://community.dynatrace.com/t/http-monitor-post-execution-script-xml-format-in-the-response/34670/2 "2022-03-30T15:46:20Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![jkinner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jkinner/32/2536_2.png) [@jkinner](https://community.dynatrace.com/u/jkinner)\
**Post date:** [October 17, 2022, 7:47pm UTC](https://community.dynatrace.com/t/http-monitor-post-execution-script-xml-format-in-the-response/34670/3 "2022-10-17T19:47:49Z")

</div>

This solution worked for me to parse some SOAP/XML.

I wish Dynatrace would update their documentation to tell you all the methods that work in the pre & post-execution boxes for synthetics. It frustrating that you have to come to the community to find out that certain javascript methods work in the boxes. Just tell us up front. The documentation for working with JSON is pretty good.
