From 0291930ccee97f88ef1b757b37eca27cbf03d7ef Mon Sep 17 00:00:00 2001 From: jpawlowski Date: Mon, 20 Mar 2017 17:08:53 +0000 Subject: [PATCH] 74_THINKINGCLEANER: add some HttpUtils_NonblockingGet() settings git-svn-id: https://svn.fhem.de/fhem/trunk@13754 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/74_THINKINGCLEANER.pm | 52 +++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/fhem/FHEM/74_THINKINGCLEANER.pm b/fhem/FHEM/74_THINKINGCLEANER.pm index fe48fa97b..6f3738c17 100644 --- a/fhem/FHEM/74_THINKINGCLEANER.pm +++ b/fhem/FHEM/74_THINKINGCLEANER.pm @@ -1094,16 +1094,23 @@ sub THINKINGCLEANER_SendCommand($$;$$) { HttpUtils_NonblockingGet( { - url => $URL, - timeout => $timeout, - noshutdown => $http_noshutdown, - data => undef, - hash => $hash, - service => $service, - cmd => $cmd, - type => $type, + url => $URL, + timeout => $timeout, + noshutdown => $http_noshutdown, + data => undef, + hash => $hash, + service => $service, + cmd => $cmd, + type => $type, + callback => \&THINKINGCLEANER_ReceiveCommand, httpversion => "1.1", - callback => \&THINKINGCLEANER_ReceiveCommand, + loglevel => AttrVal( $name, "httpLoglevel", 4 ), + header => { + Agent => 'FHEM-THINKINGCLEANER/1.0.0', + 'User-Agent' => 'FHEM-THINKINGCLEANER/1.0.0', + Accept => 'application/json;charset=UTF-8', + 'Accept-Charset' => 'UTF-8', + }, } ); @@ -1121,15 +1128,24 @@ sub THINKINGCLEANER_SendCommand($$;$$) { HttpUtils_NonblockingGet( { - url => $URL, - timeout => $timeout, - noshutdown => $http_noshutdown, - data => $cmd, - hash => $hash, - service => $service, - cmd => $cmd, - type => $type, - callback => \&THINKINGCLEANER_ReceiveCommand, + url => $URL, + timeout => $timeout, + noshutdown => $http_noshutdown, + data => $cmd, + hash => $hash, + service => $service, + cmd => $cmd, + type => $type, + callback => \&THINKINGCLEANER_ReceiveCommand, + httpversion => "1.1", + loglevel => AttrVal( $name, "httpLoglevel", 4 ), + header => { + Agent => 'FHEM-THINKINGCLEANER/1.0.0', + 'User-Agent' => 'FHEM-THINKINGCLEANER/1.0.0', + 'Content-Type' => 'application/json', + Accept => 'application/json;charset=UTF-8', + 'Accept-Charset' => 'UTF-8', + }, } ); }