Looks like code below will treat $content eq '0' as empty?
sub do_httpx3 {
my ($method, $usessl, $site, $port, $path, $headers,
$content, $mime_type, $crt_path, $key_path) = @_;
my ($response, $page, $h,$v);
if ($content) {
$mime_type = "application/x-www-form-urlencoded" unless $mime_type;
my $len = blength($content);
$content = "Content-Type: $mime_type$CRLF"
. "Content-Length: $len$CRLF$CRLF$content";
} else {
$content = "$CRLF$CRLF";
}