How can I start / stop a "Thing " with Openhab 3.2

  • Platform information:
    • Release = Raspbian GNU/Linux 10 (buster)

Kernel = Linux 5.10.17-v7l+

Platform = Raspberry Pi 4 Model B Rev 1.4

  • openHAB version: 3.2.0-SNAPSHOT - Build #2614

I have tried to stop a “Thing” in a rule. In Openhab 2x it was working:

sendHttpPutRequest(“http://user:password@192.168.1.66:8080/rest/things/blink:account:56409a639a/enable”, “application/json”, “false”, 5000)

I recieve the following warning message:
[WARN ] [s.impl.WebApplicationExceptionMapper] - javax.ws.rs.ClientErrorException: HTTP 415 Unsupported Media Type
at org.apache.cxf.jaxrs.utils.SpecExceptions.toHttpException(SpecExceptions.java:117)
at org.apache.cxf.jaxrs.utils.ExceptionUtils.toHttpException(ExceptionUtils.java:168)
at org.apache.cxf.jaxrs.utils.JAXRSUtils.findTargetMethod(JAXRSUtils.java:565)
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:182)

How can I start / stop a "Thing " with Openhab 3.2

Thanks in advance.
Martin

According to the API Docs the media type is “text/plain”, not “application/json”.