Hi

I am executing a perl script which executes a REST GET  to get all token users 
and sends an error: 

'_rc' => '405',
                                    '_headers' => bless( {
                                                           'client-date' => 
'Fri, 09 Jun 2023 00:16:20 GMT',
                                                           'title' => 'Estado 
HTTP 405 – Method Not Allowed',


What seems to be the trouble?

This is the client petition:
$VAR1 = bless( {
                 '_res' => bless( {
                                    '_rc' => '405',
                                    '_content' => '<!doctype html><html 
lang="es"><head><title>Estado HTTP 405 – Method Not Allowed</title><style 
type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b 
{color:white;background-color:#525D76;} h1 {font-size:22px;} h2 
{font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} 
.line 
{height:1px;background-color:#525D76;border:none;}</style></head><body><h1>Estado
 HTTP 405 – Method Not Allowed</h1><hr class="line" /><p><b>Tipo</b> Informe de 
estado</p><p><b>mensaje</b> Method Not Allowed</p><p><b>Descripción</b> El 
método HTTP especificado no está permitido para el recurso requerido.</p><hr 
class="line" /><h3>Apache Tomcat/9.0.43 (Debian)</h3></body></html>',
                                    '_msg' => '',
                                    '_request' => bless( {
                                                           '_content' => '',
                                                           '_uri' => bless( 
do{\(my $o = 'http://xx.xx.xx.xx:xxxx/ga/api/tokens')}, 'URI::http' ),
                                                           '_uri_canonical' => 
$VAR1->{'_res'}{'_request'}{'_uri'},
                                                           '_method' => 'GET',
                                                           '_headers' => bless( 
{
                                                                                
  'content-type' => 'application/json',
                                                                                
  'authorization' => 'Basic Y25zc2lzdGU6VDF0NG4zcyE=
',
                                                                                
  'connection' => 'close',
                                                                                
  'content-length' => 0,
                                                                                
  'user-agent' => 'REST::Client/281'
                                                                                
}, 'HTTP::Headers' )
                                                         }, 'HTTP::Request' ),
                                    '_protocol' => 'HTTP/1.1',
                                    '_headers' => bless( {
                                                           'client-date' => 
'Fri, 09 Jun 2023 00:17:38 GMT',
                                                           'allow' => 
'POST,OPTIONS',
                                                           'content-type' => 
'text/html;charset=utf-8',
                                                           'title' => 'Estado 
HTTP 405 – Method Not Allowed',
                                                           'client-peer' => 
'xx.xx.x.xxx:xxxx',
                                                           
'client-response-num' => 1,
                                                           'date' => 'Fri, 09 
Jun 2023 00:17:38 GMT',
                                                           'connection' => 
'close',
                                                           '::std_case' => {
                                                                             
'client-date' => 'Client-Date',
                                                                             
'title' => 'Title',
                                                                             
'client-peer' => 'Client-Peer',
                                                                             
'client-response-num' => 'Client-Response-Num'
                                                                           },
                                                           'content-language' 
=> 'es',
                                                           'content-length' => 
'702'
                                                         }, 'HTTP::Headers' )
                                  }, 'HTTP::Response' ),
                 '_config' => {
                                'host' => 'http://'xx.xx.x.xxx:xxxx',
                                'useragent' => bless( {
                                                        'max_size' => undef,
                                                        'max_redirect' => 7,
                                                        'def_headers' => bless( 
{
                                                                                
  'user-agent' => 'REST::Client/281'
                                                                                
}, 'HTTP::Headers' ),
                                                        'handlers' => {
                                                                        
'response_header' => bless( [
                                                                                
                      {
                                                                                
                        'm_media_type' => 'html',
                                                                                
                        'line' => '/usr/share/perl5/LWP/UserAgent.pm:768',
                                                                                
                        'callback' => sub { "DUMMY" },
                                                                                
                        'owner' => 'LWP::UserAgent::parse_head'
                                                                                
                      }
                                                                                
                    ], 'HTTP::Config' )
                                                                      },
                                                        'proxy' => {},
                                                        'no_proxy' => [],
                                                        'timeout' => 300,
                                                        'ssl_opts' => {
                                                                        
'verify_hostname' => 1
                                                                      },
                                                        'protocols_forbidden' 
=> undef,
                                                        'protocols_allowed' => 
undef,
                                                        'show_progress' => 
undef,
                                                        'local_address' => 
undef,
                                                        'send_te' => 1,
                                                        'requests_redirectable' 
=> [
                                                                                
     'GET',
                                                                                
     'HEAD'
                                                                                
   ],
                                                        'use_eval' => 1
                                                      }, 'LWP::UserAgent' )
                              }
               }, 'REST::Client' );


'http://xx.xx.xx.xx:xxxx/guacamole/ga/api/tokens' is the URL petition. 

-Gabriel

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to