- Timestamp:
- 04/04/08 11:18:34 (8 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/WebService-Simple/trunk/lib/WebService/Simple.pm
r8828 r8831 15 15 croak "paramater base_url is required" unless $opt->{base_url}; 16 16 my $self = bless { 17 ua => LWP::UserAgent->new,18 %$opt,17 ua => LWP::UserAgent->new, 18 %$opt, 19 19 }, $class; 20 20 $self; … … 29 29 30 30 sub _fetch_url{ 31 my ($self, $url) = @_;31 my ($self, $url) = @_; 32 32 my $response; 33 33 if(exists $self->{cache}){ … … 40 40 croak "can't get the request" unless $response->is_success; 41 41 if(exists $self->{cache}) { 42 $self->{cache}->freeze($url, $response);42 $self->{cache}->freeze($url, $response); 43 43 } 44 44 return $response; … … 49 49 my $base_url = $self->{base_url}; 50 50 if($path){ 51 $path =~ s!^/ !! if $base_url =~ /\/$/;51 $path =~ s!^/+!! if $base_url =~ m{/$}; 52 52 $base_url = $base_url . $path; 53 53 } … … 56 56 push(@params, $self->_hashref_to_str($self->{param})); 57 57 push(@params, $self->_hashref_to_str($request_param)); 58 my $str = join("&", @params);58 my $str = join("&", @params); 59 59 return $url . $str; 60 60 } … … 153 153 Yusuke Wada C<< <yusuke@kamawada.com> >> 154 154 155 =head1 LICENCE AND COPYRIGHT155 =head1 COPYRIGHT AND LISENCE 156 156 157 157 Copyright (c) 2008 Yusuke Wada, All rights reserved.
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)