diff options
Diffstat (limited to 'lib/Net/HTTP/Console/Dispatcher')
-rw-r--r-- | lib/Net/HTTP/Console/Dispatcher/HTTP.pm | 8 | ||||
-rw-r--r-- | lib/Net/HTTP/Console/Dispatcher/Set.pm | 14 | ||||
-rw-r--r-- | lib/Net/HTTP/Console/Dispatcher/View.pm | 2 |
3 files changed, 6 insertions, 18 deletions
diff --git a/lib/Net/HTTP/Console/Dispatcher/HTTP.pm b/lib/Net/HTTP/Console/Dispatcher/HTTP.pm index c0e24ae..88f8814 100644 --- a/lib/Net/HTTP/Console/Dispatcher/HTTP.pm +++ b/lib/Net/HTTP/Console/Dispatcher/HTTP.pm @@ -21,7 +21,7 @@ class Net::HTTP::Console::Dispatcher::HTTP with Net::HTTP::Console::Dispatcher { $self->_do_request_with_body($method, $path, $body); } else { - # XXX unsupporter method + $self->application->logger('error', 'unsupported HTTP method'); } return 1; } @@ -32,7 +32,7 @@ class Net::HTTP::Console::Dispatcher::HTTP with Net::HTTP::Console::Dispatcher { my ($content, $result) = $self->application->api_object->anonymous; $self->application->_set_and_show($content, $result); }catch{ - # XXX error + $self->application->error('error', $_); }; } @@ -58,9 +58,7 @@ class Net::HTTP::Console::Dispatcher::HTTP with Net::HTTP::Console::Dispatcher { my ($content, $result) = $self->application->api_object->anonymous; $self->application->_set_and_show($content, $result); }catch{ - warn $_; - use YAML::Syck; - warn Dump $_->http_error; + $self->application->error('error', $_); }; } } diff --git a/lib/Net/HTTP/Console/Dispatcher/Set.pm b/lib/Net/HTTP/Console/Dispatcher/Set.pm index f97474b..d514f37 100644 --- a/lib/Net/HTTP/Console/Dispatcher/Set.pm +++ b/lib/Net/HTTP/Console/Dispatcher/Set.pm @@ -13,10 +13,6 @@ class Net::HTTP::Console::Dispatcher::Set with Net::HTTP::Console::Dispatcher { }elsif($command eq 'unset') { $self->_unset_header($key) if $type eq 'header'; } - - # elsif ($command eq 'show_defined_headers') { - # $self->_show_defined_headers(); - # } } method pattern($input) { @@ -25,19 +21,13 @@ class Net::HTTP::Console::Dispatcher::Set with Net::HTTP::Console::Dispatcher { method _set_header($header, $value) { $self->application->set_header($header, $value); - print "header $header set to $value\n"; + $self->application->print("header $header set to $value"); } method _unset_header($header) { $self->application->delete_header($header); - print "header $header unset\n"; + $self->application->print("header $header unset"); } - - # method _show_defined_headers { - # foreach ($self->application->all_headers) { - # print $_->[0].": ".$_->[1]."\n"; - # } - # } } 1; diff --git a/lib/Net/HTTP/Console/Dispatcher/View.pm b/lib/Net/HTTP/Console/Dispatcher/View.pm index 059fe53..5b52fc0 100644 --- a/lib/Net/HTTP/Console/Dispatcher/View.pm +++ b/lib/Net/HTTP/Console/Dispatcher/View.pm @@ -19,7 +19,7 @@ class Net::HTTP::Console::Dispatcher::View with Net::HTTP::Console::Dispatcher { } elsif ($key eq 'defined_headers') { foreach ($self->application->all_headers) { - print $_->[0] . ': ' . $_->[1] . "\n"; + $self->application->print( $_->[0] . ': ' . $_->[1]); } } } |