How to get XML string back from HTTPGET method?

I can't get the httpget method in my new driver to bypass the conversion of the XML response to GPathResult and give me an XML STRING instead. Give me exactly what was sent, a plain text string. It looks like the textParser=true parameter is supposed to do that, but I can't get it working. I do like the ease of getting the data I need out of a gpathresult, and my driver is working great, but when I have to get a big collection, change one attribute, and then PUT that collection back, I can't use it. To send XML, I have to pass a string and I can't rebuild the XML from the gpath. That would be a nightmare. All I want to do is a simple find/replace in a string and send it back. I'm at a loss. Anyone out here got a solution that works? Thanks!

I'll check it out. Need to run a few tests.

1 Like

This works for me, it puts raw XML in the log, which is then rendered by the browser.

httpGet([ uri: "https://www.w3schools.com/xml/plant_catalog.xml", textParser: true ], {
    log.debug it.data.text
})

Groovy! I will play around with that... thanks for digging that up for me!

1 Like