Skip to content

Commit

Permalink
Add rest request header connection keep-alive (#256)
Browse files Browse the repository at this point in the history
Signed-off-by: jsetton <[email protected]>
  • Loading branch information
jsetton authored Aug 20, 2019
1 parent 84d3387 commit f6c04d0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lambda/smarthome/lib/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ function getItemOrItems(token, itemName, parameters) {
method: 'GET',
uri: `${config.openhab.baseURL}/items${itemName ? '/' + itemName : ''}${parameters ? '?' + qs.stringify(parameters) : ''}`,
headers: {
'Connection': 'keep-alive',
'Content-Type': 'text/plain'
},
json: true
Expand All @@ -135,6 +136,7 @@ function getRegionalSettings(token) {
method: "GET",
uri: `${config.openhab.baseURL}/services/org.eclipse.smarthome.core.i18nprovider/config`,
headers: {
'Connection': 'keep-alive',
'Content-Type': 'text/plain'
},
json: true
Expand All @@ -154,6 +156,7 @@ function postItemCommand(token, itemName, value) {
method: 'POST',
uri: `${config.openhab.baseURL}/items/${itemName}`,
headers: {
'Connection': 'keep-alive',
'Content-Type': 'text/plain'
},
body: value.toString()
Expand Down

0 comments on commit f6c04d0

Please sign in to comment.