Line: 112 to 112 | ||||||||
---|---|---|---|---|---|---|---|---|
Changed: | ||||||||
< < | getExternalResource( $url ) -> $response | |||||||
> > | @hea | |||||||
Get whatever is at the other end of a URL (using an HTTP GET request). Will
only work for encrypted protocols such as https if the LWP CPAN module is
installed.
Note that the $url may have an optional user and password, as specified by | ||||||||
Changed: | ||||||||
< < | the relevant RFC. Any proxy set in configure is honoured. | |||||||
> > | the relevant RFC. Any proxy set in configure is honored.
Optional headers may be supplied of form 'name1', 'value1', 'name2', 'value2'.
Do not add a User-Agent header, it will be added. | |||||||
The $response is an object that is known to implement the following subset of
the methods of LWP::Response . It may in fact be an LWP::Response object, | ||||||||
Line: 151 to 154 | ||||||||
my $response = TWiki::Func::getExternalResource($url); if (!$response->is_error() && $response->isa('HTTP::Response')) { | ||||||||
Changed: | ||||||||
< < | ... other methods of HTTP::Response may be called | |||||||
> > | $text = $response->content(); # ... other methods of HTTP::Response may be called | |||||||
} else { | ||||||||
Changed: | ||||||||
< < | ... only the methods listed above may be called | |||||||
> > | # ... only the methods listed above may be called | |||||||
} |