From d1075308b1fe529de07d43e4bfd42abbadd2465f Mon Sep 17 00:00:00 2001 From: Matt Motherway Date: Mon, 26 Mar 2018 16:41:02 -0700 Subject: [PATCH] Include 'Content-Type': 'application/json' header This was necessary to get the REST API working using a password other than 'password'. --- lib/ha-api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ha-api.js b/lib/ha-api.js index 8c61e68..a3059ba 100644 --- a/lib/ha-api.js +++ b/lib/ha-api.js @@ -9,7 +9,7 @@ class HaApi { const apiOpts = { baseURL: config.baseUrl + '/api' }; apiOpts.headers = (config.apiPass) - ? { 'x-ha-access': config.apiPass } + ? { 'x-ha-access': config.apiPass, 'Content-Type': 'application/json' } : {}; this.client = axios.create(apiOpts);