Net::U...sponse(3pm)
β¨ NAME β¨
Net::UPnP::QueryResponse β the Perl extension for UPnP, bestie π
π SYNOPSIS π
okay so here's the whole vibe, copy it exactly, no cap:
use Net::UPnP::ControlPoint;
my $obj = Net::UPnP::ControlPoint->new();
@dev_list = $obj->search(st =>'upnp:rootdevice', mx => 3);
$devNum= 0;
foreach $dev (@dev_list) {
$device_type = $dev->getdevicetype();
if ($device_type ne 'urn:schemas-upnp-org:device:MediaServer:1') {
next;
}
print "[$devNum] : " . $dev->getfriendlyname() . "\n";
unless ($dev->getservicebyname('urn:schemas-upnp-org:service:ContentDirectory:1')) {
next;
}
$condir_service = $dev->getservicebyname('urn:schemas-upnp-org:service:ContentDirectory:1');
unless (defined(condir_service)) {
next;
}
%action_in_arg = (
'ObjectID' => 0,
'BrowseFlag' => 'BrowseDirectChildren',
'Filter' => '*',
'StartingIndex' => 0,
'RequestedCount' => 0,
'SortCriteria' => '',
);
$action_res = $condir_service->postcontrol('Browse', \%action_in_arg);
unless ($action_res->getstatuscode() == 200) {
next;
}
$actrion_out_arg = $action_res->getargumentlist();
unless ($actrion_out_arg->{'Result'}) {
next;
}
$result = $actrion_out_arg->{'Result'};
while ($result =~ m/<dc:title>(.*?)<\/dc:title>/sgi) {
print "\t$1\n";
}
$devNum++;
}
πΈ DESCRIPTION πΈ
So like, this package is the object you get handed back for an action response π . That's its whole job. It's giving "I hold the reply, you ask me questions about it."
π¦ METHODS π¦
getstatuscode β get the status code
$status_code = $queryres->getstatuscode();
Grabs the status code off the SOAP response. Like, was it a 200 or were we in our flop era? This tells you π«Ά.
getvalue β get the return value
$value = $queryres->getvalue();
Gets the value of the SOAP response. That's it, that's the method β¨.
π AUTHOR π
Satoshi Konno skonno@cybergarage.org
CyberGarage http://www.cybergarage.org
π COPYRIGHT AND LICENSE π
Copyright (C) 2005 by Satoshi Konno
It may be used, redistributed, and/or modified under the terms of BSD License. Slay, honestly β permissive licensing is the moment.
This icon of a page is from the User Contributed Perl Documentation, and the footer was literally serving perl v5.36.0 dated 2022-12-06. That's the whole manual bestie, go forth and query those responses π
β¨π¦
π¦ where this page comes from
- debian bookworm: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- debian trixie: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- ubuntu noble: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- ubuntu resolute: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- ubuntu stonking: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms