-
-
Save tbrowder/1edc730800580626b359fe560c495353 to your computer and use it in GitHub Desktop.
LibCurl use
This file contains 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
# assemble a constant API call portion | |
my $Call = "{$service-url}/xml.response?"; | |
$Call ~= "ApiUser={$ncuser}&ApiKey={$service-key}"; | |
$Call ~= "&UserName={$ncuser}&ClientIP={$client-ip}"; | |
$Call ~= "&Command=namecheap."; # <= note the trailing dot | |
# get the list of doms | |
get-hosts-list; | |
sub get-hosts-list() { | |
my $call = $Call ~ "domains.getList&PageSize=100"; | |
if $debug { | |
say $call; | |
exit; | |
} | |
my $http = LibCurl::HTTP.new; | |
my $xml = $http.GET($call).perform.content; | |
say $xml; | |
# $http.GET('http://example.com').perform.content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment