perl6 Socket: 发送HTTP请求

sub MAIN(Str $host,Str $path,  Int $port) {
my $send = "GET $path HTTP/1.1\r\nHost: $host\r\n\r\n";
my $c = IO::Socket::INET.new(:host($host), :port($port));
$c.print: $send;
while (my $buff = $c.recv()) {
say $buff.print;
}
$c.close;
}
上一篇:linux磁盘空间用满的处理方法


下一篇:nginx 设置默认虚拟 host