Peter Pentchev


WWW::Domain::Registry::Joker::Response - parse a DMAPI response


  use WWW::Domain::Registry::Joker::Response;

  $r = new WWW::Domain::Registry::Joker::Response();
  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 DMAPI. It examines a response object, extracts the status and error flags, codes, and descriptive messages, and makes them available as Perl object members.


The WWW::Domain::Registry::Joker::Response class defines the following methods:

new ()

Initialize a WWW::Domain::Registry::Joker::Response object. No user-serviceable parameters inside.

parse ( RESPONSE )

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.


Create an object and parse an HTTP response:

  $r = new WWW::Domain::Registry::Joker::Response();
  eval {
  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 - the DMAPI documentation


None known so far ;)


The WWW::Domain::Registry::Joker::Response class was written by Peter Pentchev in 2007.


Peter Pentchev, <>


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.