WWW::Domain::Registry::Joker::Response - parse a DMAPI response
use WWW::Domain::Registry::Joker::Response; $r = new WWW::Domain::Registry::Joker::Response(); $r->parse($resp); print "$r->{Proc-Id}: $r->{'Status-Code'} $r->{Status-Text}\n";
The WWW::Domain::Registry::Joker::Response class is a helper parser for the HTTP responses returned by the Joker.com DMAPI. It examines a response object, extracts the status and error flags, codes, and descriptive messages, and makes them available as Perl object members.
WWW::Domain::Registry::Joker::Response
The WWW::Domain::Registry::Joker::Response class defines the following methods:
Initialize a WWW::Domain::Registry::Joker::Response object. No user-serviceable parameters inside.
Parse a HTTP::Response from the DMAPI and store the result code, message, error, etc. into the respective fields of the object. In addition to the code, msg, status, and success members described above, the parse() method may also set the Version, Proc-Id, Status-Text, Status-Code, Error, and any other result description members as listed in the DMAPI specification.
HTTP::Response
code
msg
status
success
parse()
Version
Proc-Id
Status-Text
Status-Code
Error
Create an object and parse an HTTP response:
$r = new WWW::Domain::Registry::Joker::Response(); eval { $r->parse($resp); }; if ($@) { print STDERR "Could not parse the DMAPI response: $@\n"; } elsif (!$r->{'success'}) { print STDERR "DMAPI error: code $r->{code}, text $r->{msg}\n"; print STDERR "DMAPI error message: $r->{Error}\n" if $r->{'Error'}; } else { print "Successful DMAPI request: $r->{code} $r->{msg}\n"; print "Tracking process ID: $r->{Proc-ID}\n" if $r->{'Proc-ID'}; }
The parse() method will die on invalid input:
no response parameter passed in;
the response parameter was not an HTTP::Response or compatible object.
If the response object is a valid DMAPI response, its success, code, msg, Error, and other attributes are exposed as members of the WWW::Domain::Registry::Joker::Response object as shown above.
WWW::Domain::Registry::Joker, HTTP::Response
https://joker.com/faq/category/39/22-dmapi.html - the Joker.com DMAPI documentation
None known so far ;)
The WWW::Domain::Registry::Joker::Response class was written by Peter Pentchev in 2007.
Peter Pentchev, <roam@ringlet.net>
Copyright (C) 2007 by Peter Pentchev
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install WWW::Domain::Registry::Joker, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Domain::Registry::Joker
CPAN shell
perl -MCPAN -e shell install WWW::Domain::Registry::Joker
For more information on module installation, please visit the detailed CPAN module installation guide.