quotes and more useful sendCmd debugging.

This commit is contained in:
Isaac Connor 2019-10-03 17:27:46 -04:00
parent 714ce0ba60
commit a7f27dddde
1 changed files with 3 additions and 3 deletions

View File

@ -134,7 +134,7 @@ sub sendCmd
my $server_endpoint = "http://".$host.":".$port."/$cmd"; my $server_endpoint = "http://".$host.":".$port."/$cmd";
my $req = HTTP::Request->new( POST => $server_endpoint ); my $req = HTTP::Request->new( POST => $server_endpoint );
$req->header('content-type' => $content_type); $req->header('content-type' => $content_type);
$req->header('Host' => $host.":".$port); $req->header('Host' => $host.':'.$port);
$req->header('content-length' => length($msg)); $req->header('content-length' => length($msg));
$req->header('accept-encoding' => 'gzip, deflate'); $req->header('accept-encoding' => 'gzip, deflate');
$req->header('connection' => 'close'); $req->header('connection' => 'close');
@ -145,9 +145,9 @@ sub sendCmd
if ( $res->is_success ) { if ( $res->is_success ) {
$result = !undef; $result = !undef;
} else { } else {
Error( "After sending PTZ command, camera returned the following error:'".$res->status_line()."'" ); Error("After sending PTZ command to $server_endpoint, camera returned the following error:'".$res->status_line()."'" );
} }
return( $result ); return $result;
} }
sub getCamParams sub getCamParams