Yeah I am afraid Groovy is quite different in this case anyway. This is what is looks like. I am 99% sure my problem lies with the line data: ["āattributesā: {āhiddenā: ātrueā, āfriendly_nameā: āthe periodā}, āstateā: ā4ā" ]
Ugh, I get some weird dyslexia thing when I look at code with those weird lambda things in, thatās one part of kotlin I still scratch my head over (amongst many others).
I take it you want the catch block to see why httpPostJson(params) is failing? If so it should just be wrapping it and printing the exception, no?
I am afraid I have hit a wall. I hate Groovy with a passion. Being a āchild of the 60sā Groovy is NOT groovy
Not matter what I try I always get back the error java.lang.SecurityException: Getting properties on class java.lang.Class is not allowed @line 265 (sendHTTPPost)
I even stripped the params definition down to only the uri and path to see if the error changes. Same thing. I know that the uri and path are correct as I copied it from the working python scripts.
I dont often give up but this one has me stumped. I hope the many proficient Groovy programmer of the Smartthings forum can shed some light.
Anyway, thank you very much for your effort. Stay tuned
the lines are posted are as far as I can go/show. the httpPosJson() is a library call. Here is the documentation for it:
httpPostJson()
Executes an HTTP POST request with a JSON-encoded body and content type, and passes control to the specified closure. The closure is passed one HttpResponseDecorator argument from which the response content and header information can be extracted.
If the response content type is JSON, the response data will automatically be parsed into a data structure.
@cdikland Oh this is the Samsung SmartThings Geoovy? I donāt know how much I can help with that. Did you try copy and pasting the example code for httpPostJson from the docs?
I āsolvedā the problem by rewriting the python script into php. From within Groovy I call the webserver/script using Groovy library function httpGet. Not pretty but it works