| WWW-OpenSearch documentation | Contained in the WWW-OpenSearch distribution. |
WWW::OpenSearch::Agent - An agent for doing OpenSearch requests
An alias for request()
Copyright 2005-2010 by Tatsuhiko Miyagawa and Brian Cassidy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| WWW-OpenSearch documentation | Contained in the WWW-OpenSearch distribution. |
package WWW::OpenSearch::Agent; use strict; use warnings; use base qw( LWP::UserAgent ); use WWW::OpenSearch; use WWW::OpenSearch::Response;
sub new { my ( $class, @rest ) = @_; return $class->SUPER::new( agent => join( '/', __PACKAGE__, $WWW::OpenSearch::VERSION ), @rest, ); } *search = \&request; sub request { my $self = shift; my $request = shift; my $response = $self->SUPER::request( $request, @_ ); # allow regular HTTP::Requests to flow through return $response unless $request->isa( 'WWW::OpenSearch::Request' ); return WWW::OpenSearch::Response->new( $response ); } 1;