How to send a http PUT with xml data

Hello... Have you found something that works for you yet? Just wondering because I'm in the same boat, just now migrating from Vera to HE and trying to develop a driver for virtual devices that can GET/PUT XML "files" to/from my Hikvision cameras to control a few features and trigger alarms so I can get notifications from the camera too when events on HE happen.

After reviewing this post, and trying out the coded generated by AI, which is really cool, I discovered that won't work on HE because it's using the HTTPBuilder class to provide the Digest authentication method, which HE Groovy doesn't allow in their code.

To get past that, I reconfigured my cameras to accept Basic authentication and included that in my headers, using a Base64 encoded value for "userid:password", like this:

def headers = [:] 
headers.put("HOST", "${deviceIP}:${port}")
headers.put("Authorization", "Basic ${strCred})
headers.put("Content-Type", "application/xml; charset=UTF-8")

This is supported by both httpGet/Put and HubAction methods.

So that got my me logged in and able to GET data. Now I just need to figure out how to build and parse the XML messages. Groovy is doing strange things with my xml "strings" so I'm trying figure that out and will create a new topic for it if needed. First, I have to check out XMLSlurper.

So let me know if you've something good to share... Thanks!