Plack套件通常使用http:// 0:port.例如.下列
plackup -MPlack::App::Directory -e 'Plack::App::Directory->new(root=>".");'
版画
HTTP::Server::PSGI: Accepting connections at http://0:5000/
但是,LWP :: UserAgent(或一些更深层次的模块)不接受它,例如的:
perl -MLWP::UserAgent -E '$u=LWP::UserAgent->new;$res=$u->get("http://0:5000/valid/path");print $res->status_line'
打印:
500 No Host option provided
但是
perl -MLWP::UserAgent -E '$u=LWP::UserAgent->new;$res=$u->get("http://localhost:5000/valid/path");print $res->status_line'
版画
200 OK
问题是:谁错了?