Skip to content

Instantly share code, notes, and snippets.

@shelling
Created March 31, 2010 11:25
Show Gist options
  • Select an option

  • Save shelling/350205 to your computer and use it in GitHub Desktop.

Select an option

Save shelling/350205 to your computer and use it in GitHub Desktop.
Example of how to do POST action with HTTP::Request::Common
#!/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