perl 使用post和get

perl 使用post和get,第1张

概述url 传参格式:perl get 方式请求:use Encode;use Encode::CN;use JSON; use URI::Escape;use LWP::Simple;#$host = "http://ip.taobao.com/service/getIpInfo.php?ip=202.101.172.35";$host = " http://211.149.19
url 传参格式:perl get 方式请求:use Encode;use Encode::CN;use JsON; use URI::Escape;use LWP::Simple;#$host = "http://ip.taobao.com/service/getIpInfo.PHP?ip=202.101.172.35";$host = " http://211.149.197.95:8888/sms.aspx?action=send&userID=74&account=xx&password=xx&mobile=18072xx7&content=内容&sendTime=&extno=";$content = get($host);print "$content is $content\n";通过get方式请求,参数所以用“&”符号来隔开。perl post 方式请求:use strict;use LWP;my $browser = LWP::UserAgent->new();my $response= $browser->post("http://211.149.197.95:8888/sms.aspx",[ "action" => "send","userID" => "74","account" => "xx","password" => xx,"mobile" =>180xx237,"content" =>"test0612"]); #多加了一个被发送的数据的数组print $response->content; # 输出获得的网页内容
总结

以上是内存溢出为你收集整理的perl 使用post和get全部内容,希望文章能够帮你解决perl 使用post和get所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/langs/1273324.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-08
下一篇2022-06-08

发表评论

登录后才能评论

评论列表(0条)

    保存