Created
March 31, 2010 11:25
-
-
Save shelling/350205 to your computer and use it in GitHub Desktop.
Example of how to do POST action with HTTP::Request::Common
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use HTTP::Request::Common; | |
| use LWP::UserAgent; | |
| use pQuery; | |
| sub whois_tanic { | |
| my ($query, $sld) = @_; | |
| $response = LWP::UserAgent->new()->request(POST "http://www.twnic.net.tw/b5whois.cgi", [ query => $query, sld => $sld ]); | |
| pQuery($response->content)->find("pre")->html; | |
| } | |
| print whois("ntu","tw"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment