HTTP API - Cors and JQuery if quey comes from remote host

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
Boxson
Posts: 29
Joined: 21 Sep 2016 20:00

HTTP API - Cors and JQuery if quey comes from remote host

Post by Boxson »

Hi,

does anybody have a running example of pulling a sensors value from Z-Way HTTP API by javascript from another host?

If i don't add an authentication header to the javascipt request, Z-Way API responds with a 401 - message.
If i add an authentication header so the javascript request, i get a CORS error shown.

Is there a way to have Z-Way API allow javscript based requests from external hosts (e.g. another webserver running at the same network).

Regards

Boxson
Last edited by Boxson on 27 Sep 2016 17:59, edited 1 time in total.
Boxson
Posts: 29
Joined: 21 Sep 2016 20:00

Re: HTTP API - Cors and JQuery

Post by Boxson »

I made a commit at git (https://github.com/Z-Wave-Me/home-autom ... 70901a8604) solving this. Shall be available with one of the upcoming releases. If you want to use it before next release, add the single line of code by yourself and restart the Z-Way System.
Post Reply