You get different output, depending on where you set 'with_encoding_types' to 1. If
you send this:
{ 'object' => 'domain',
'attributes' => {
'page' => 0,
'type' => 'list'
},
'cookie' => '357926093:3327054',
'action' => 'get'
},
you get a list of scalars:
{ 'object' => 'DOMAIN',
'response_text' => 'Command Successful',
'attributes' => {
'count' => '2',
'remainder' => '0',
'domain_list' => [
'api-test-dev-20020103140045-3522-common.com',
'api-test-dev-20020103140045-3522-common2.com'
],
...
But if you send this:
{ 'object' => 'domain',
'attributes' => {
'with_encoding_types' => 1,
'page' => 0,
'type' => 'list'
},
'cookie' => '357926093:3327054',
'action' => 'get'
};
you get a list of hash references:
{ 'object' => 'DOMAIN',
'response_text' => 'Command Successful',
'attributes' => {
'count' => '2',
'remainder' => '0',
'domain_list' => [
{'domain' => 'api-test-dev-20020103140045-3522-common.com',
'encoding_type' => undef
},
{'domain' => 'api-test-dev-20020103140045-3522-common2.com',
'encoding_type' => undef
}
],
...
The reason for this behaviour was to keep backward compatibility while adding
more info.
Regards,
Vlad Jebelev
OpenSRS developer
On Fri, 22 Mar 2002, Fagyal Csongor wrote:
> Hi all,
>
>
> I have issued a get_domain, type="list" command. Part of what I get is this:
>
> ...
> 'domain_list' => [
> 'domain1',
> 'domain2',
> ...
> 'domainN'
> ],
> ...
>
>
> The docs say I should get:
>
> 'domain_list' => [
> { 'domain' => 'domain1', 'encoding_type' => ""},
> { 'domain' => 'domain2', 'encoding_type' => ""}
> ...
> ],
>
> Even though encoding_type is "optional", domain_list should be an array of hashes
>IMHO, but I get a simple array of scalars.What am I missing?
>
>
> Regards,
> - Csongor
>
>