Ven*_*tsu 13
请参阅CGI/MIXING POST和URL PARAMETERS.
简短版本:$CGI->param()用于后期参数和$CGI->url_param()查询字符串参数.
转储CGI有利于更好的界面.Plack的param方法返回GET和POST参数混合.
plackup -MPlack::Request -e 'sub {
my ($env) = @_;
my $r = Plack::Request->new($env);
return [200, ["Content-Type" => "text/plain"], [join "\n", $r->param("foo")]];
}'
Run Code Online (Sandbox Code Playgroud)
> lwp-request -m POST -USe 'http://localhost:5000/fnord?foo=bar;baz=quux'
Please enter content (application/x-www-form-urlencoded) to be POSTed:
foo=123;baz=456
?
POST http://localhost:5000/fnord?foo=bar;baz=quux
User-Agent: lwp-request/6.03 libwww-perl/6.03
Content-Length: 16
Content-Type: application/x-www-form-urlencoded
200 OK
Date: Thu, 27 Oct 2011 21:27:46 GMT
Server: HTTP::Server::PSGI
Content-Length: 7
Content-Type: text/plain
Client-Date: Thu, 27 Oct 2011 21:27:46 GMT
Client-Peer: 127.0.0.1:5000
Client-Response-Num: 1
bar
123
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5168 次 |
| 最近记录: |