Plack-App-MCCS
view release on metacpan or search on metacpan
local/lib/perl5/LWP/UserAgent.pm view on Meta::CPAN
variable. If this environment variable isn't set; then C<verify_hostname>
defaults to 1.
=item C<SSL_ca_file> => $path
The path to a file containing Certificate Authority certificates.
A default setting for this option is provided by checking the environment
variables C<PERL_LWP_SSL_CA_FILE> and C<HTTPS_CA_FILE> in order.
=item C<SSL_ca_path> => $path
The path to a directory containing files containing Certificate Authority
certificates.
A default setting for this option is provided by checking the environment
variables C<PERL_LWP_SSL_CA_PATH> and C<HTTPS_CA_DIR> in order.
=back
Other options can be set and are processed directly by the SSL Socket implementation
in use. See L<IO::Socket::SSL> or L<Net::SSL> for details.
The libwww-perl core no longer bundles protocol plugins for SSL. You will need
to install L<LWP::Protocol::https> separately to enable support for processing
https-URLs.
=head2 timeout
my $secs = $ua->timeout;
$ua->timeout( $secs );
Get/set the timeout value in seconds. The default value is
180 seconds, i.e. 3 minutes.
The request is aborted if no activity on the connection to the server
is observed for C<timeout> seconds. This means that the time it takes
for the complete transaction and the L<LWP::UserAgent/request> method to
actually return might be longer.
When a request times out, a response object is still returned. The response
will have a standard HTTP Status Code (500). This response will have the
"Client-Warning" header set to the value of "Internal response". See the
L<LWP::UserAgent/get> method description below for further details.
=head1 PROXY ATTRIBUTES
The following methods set up when requests should be passed via a
proxy server.
=head2 env_proxy
$ua->env_proxy;
Load proxy settings from C<*_proxy> environment variables. You might
specify proxies like this (sh-syntax):
gopher_proxy=http://proxy.my.place/
wais_proxy=http://proxy.my.place/
no_proxy="localhost,example.com"
export gopher_proxy wais_proxy no_proxy
csh or tcsh users should use the C<setenv> command to define these
environment variables.
On systems with case insensitive environment variables there exists a
name clash between the CGI environment variables and the C<HTTP_PROXY>
environment variable normally picked up by C<env_proxy>. Because of
this C<HTTP_PROXY> is not honored for CGI scripts. The
C<CGI_HTTP_PROXY> environment variable can be used instead.
=head2 no_proxy
$ua->no_proxy( @domains );
$ua->no_proxy('localhost', 'example.com');
$ua->no_proxy(); # clear the list
Do not proxy requests to the given domains. Calling C<no_proxy> without
any domains clears the list of domains.
=head2 proxy
$ua->proxy(\@schemes, $proxy_url)
$ua->proxy(['http', 'ftp'], 'http://proxy.sn.no:8001/');
# For a single scheme:
$ua->proxy($scheme, $proxy_url)
$ua->proxy('gopher', 'http://proxy.sn.no:8001/');
# To set multiple proxies at once:
$ua->proxy([
ftp => 'http://ftp.example.com:8001/',
[ 'http', 'https' ] => 'http://http.example.com:8001/',
]);
Set/retrieve proxy URL for a scheme.
The first form specifies that the URL is to be used as a proxy for
access methods listed in the list in the first method argument,
i.e. C<http> and C<ftp>.
The second form shows a shorthand form for specifying
proxy URL for a single access scheme.
The third form demonstrates setting multiple proxies at once. This is also
the only form accepted by the constructor.
=head1 HANDLERS
Handlers are code that injected at various phases during the
processing of requests. The following methods are provided to manage
the active handlers:
=head2 add_handler
$ua->add_handler( $phase => \&cb, %matchspec )
Add handler to be invoked in the given processing phase. For how to
specify C<%matchspec> see L<HTTP::Config/"Matching">.
The possible values C<$phase> and the corresponding callback signatures are as
follows. Note that the handlers are documented in the order in which they will
be run, which is:
( run in 4.243 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )