Page 1 of 1

Problem med REST

Posted: Wed Dec 17, 2014 7:55 pm
by TotalPE
Har haft funtion i REST funtionen i min installation, men nu fungerar inte POST, GET fungerar dock. Tror att det slutade fungera i senaste uppdateringen (nightly)

/c

Re: Problem med REST

Posted: Thu Dec 18, 2014 7:42 am
by TotalPE
Kan tillägga att jag kör RaspberryPI versionen

Re: Problem med REST

Posted: Thu Dec 18, 2014 8:09 am
by TotalPE
Den säger så här i loggarna när jag skickar /rest/items/72/actions/off/invoke mot min Pi via en webbrowser.

14.12.17 19:26:47 ExceptionHandler failed to execute
14.12.17 19:26:47 SynchronousDispatcher PathInfo: /rest/items/72/actions/off/invoke

Re: Problem med REST

Posted: Thu Dec 18, 2014 9:42 pm
by stefangsbb
I am not sure how you are invoking the REST call, but the reason may be that you are trying to call the service by putting the URL of the call in the address field of the browser and fetching it that way? This will result in the browser issuing a GET-request and there is no GET request defined for that path, which will result in a return code 405 (Method not allowed) and the log you described. To invoke the method you have to issue the POST method with the URL as specified in the documentation.

I downloaded the 2014-09-09-wheezy-raspbian, and installed the latest nightly build on that and issued a POST with the Postman-plugin from Chrome on http://192.168.1.110:8020/rest/items/56 ... gle/invoke. This worked fine and toggled the lamp. I then changed the invoke method to GET with the same URL and got the error logs you describe. I can really recommend the Postman Chrome plugin for experimenting with REST services.

Hope this helps