Hi everyone. I'm revisiting an error originally reported by @Tursoe and @user2509 where the driver does not work and logs show the following error:
org.xml.sax.SAXParseException: Content is not allowed in prolog. on line 256 (method parse)
I was unable to reproduce this behavior at that time because my cameras did not exhibit this behavior. I recently added a G2 (DS-2CD2347G2-LU) camera and I am seeing this same issue.
After a brief investigation, I see that the newer cameras send a different POST message. Older cameras sends POSTs with content-type application/xml; charset="UTF-8"
and the XML is in the body of the message.
On newer cameras, it sends POSTs with content-type multipart/form-data; boundary=boundary
and the XML is a file.
Unfortunately, due to my limited experience is SW development, Groovy, & Hubitat development, I don't know to properly handle this. I've created a thread in the Developers section to ask for help. If anyone can point me in the right direction, I would appreciate it. I would like to have this fixed.