2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

HttpUtils: HTTP version reverted to 1.0, set $hash->{httpversion} for other

git-svn-id: https://svn.fhem.de/fhem/trunk@6067 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2014-06-05 08:04:57 +00:00
parent a58947b797
commit 8f42289fc1

View File

@ -188,9 +188,10 @@ HttpUtils_Connect2($)
my $method = $hash->{method}; my $method = $hash->{method};
$method = ($data ? "POST" : "GET") if( !$method ); $method = ($data ? "POST" : "GET") if( !$method );
my $hdr = "$method $hash->{path} HTTP/1.1\r\n"; my $httpVersion = $hash->{httpversion} ? $hash->{httpversion} : "1.0";
my $hdr = "$method $hash->{path} HTTP/$httpVersion\r\n";
$hdr .= "Host: $hash->{host}\r\n"; $hdr .= "Host: $hash->{host}\r\n";
$hdr .= "Connection: Close\r\n"; $hdr .= "Connection: Close\r\n" if($httpVersion ne "1.0");
$hdr .= "Authorization: Basic $hash->{auth}\r\n" if(defined($hash->{auth})); $hdr .= "Authorization: Basic $hash->{auth}\r\n" if(defined($hash->{auth}));
$hdr .= $hash->{header}."\r\n" if(defined($hash->{header})); $hdr .= $hash->{header}."\r\n" if(defined($hash->{header}));
if(defined($data)) { if(defined($data)) {
@ -305,7 +306,7 @@ HttpUtils_ParseAnswer($$)
# url, callback # url, callback
# optional(default): # optional(default):
# hideurl(0),timeout(4),data(""),loglevel(4),header(""), # hideurl(0),timeout(4),data(""),loglevel(4),header(""),
# noshutdown(1),shutdown(0), # noshutdown(1),shutdown(0),httpversion("1.0")
# method($data ? "POST" : "GET") # method($data ? "POST" : "GET")
# Example: # Example:
# HttpUtils_NonblockingGet({ # HttpUtils_NonblockingGet({