Plack-App-MCCS
view release on metacpan or search on metacpan
local/lib/perl5/URI.pm view on Meta::CPAN
returned.
If additional arguments are given, they are used to update successive
parameters with the given key. If any of the values provided are
array references, then the array is dereferenced to get the actual
values.
Please note that you can supply multiple values to this method, but you cannot
supply multiple keys.
Do this:
$uri->query_param( widget_id => 1, 5, 9 );
Do NOT do this:
$uri->query_param( widget_id => 1, frobnicator_id => 99 );
=item $u->query_param_append($key, $value,...)
Adds new parameters with the given
key without touching any old parameters with the same key. It
can be explained as a more efficient version of:
$u->query_param($key,
$u->query_param($key),
$value,...);
One difference is that this expression would return the old values
of $key, whereas the query_param_append() method does not.
=item @values = $u->query_param_delete($key)
=item $first_value = $u->query_param_delete($key)
Deletes all key/value pairs with the given key.
The old values are returned. In a scalar context, only the first value
is returned.
Using the query_param_delete() method is slightly more efficient than
the equivalent:
$u->query_param($key, []);
=item $hashref = $u->query_form_hash
=item $u->query_form_hash( \%new_form )
Returns a reference to a hash that represents the
query form's key/value pairs. If a key occurs multiple times, then the hash
value becomes an array reference.
Note that sequence information is lost. This means that:
$u->query_form_hash($u->query_form_hash);
is not necessarily a no-op, as it may reorder the key/value pairs.
The values returned by the query_param() method should stay the same
though.
=item $uri->query_keywords
=item $uri->query_keywords( $keywords, ... )
=item $uri->query_keywords( \@keywords )
Sets and returns query components that use the
keywords separated by "+" format.
The keywords can be set either by passing separate keywords directly
or by passing a reference to an array of keywords. Passing an empty
array removes the query component, whereas passing no arguments at
all leaves the component unchanged. The old value is always returned
as a list of separate words.
=back
=head1 SERVER METHODS
For schemes where the I<authority> component denotes an Internet host,
the following methods are available in addition to the generic
methods.
=over 4
=item $uri->userinfo
=item $uri->userinfo( $new_userinfo )
Sets and returns the escaped userinfo part of the
authority component.
For some schemes this is a user name and a password separated by
a colon. This practice is not recommended. Embedding passwords in
clear text (such as URI) has proven to be a security risk in almost
every case where it has been used.
=item $uri->host
=item $uri->host( $new_host )
Sets and returns the unescaped hostname.
If the C<$new_host> string ends with a colon and a number, then this
number also sets the port.
For IPv6 addresses the brackets around the raw address is removed in the return
value from $uri->host. When setting the host attribute to an IPv6 address you
can use a raw address or one enclosed in brackets. The address needs to be
enclosed in brackets if you want to pass in a new port value as well.
my $uri = URI->new("http://www.\xC3\xBCri-sample/foo/bar.html");
print $u->host; # www.xn--ri-sample-fra0f
=item $uri->ihost
Returns the host in Unicode form. Any IDNA A-labels (encoded unicode chars with
I<xn--> prefix) are turned into U-labels (unicode chars).
my $uri = URI->new("http://www.\xC3\xBCri-sample/foo/bar.html");
print $u->ihost; # www.\xC3\xBCri-sample
=item $uri->port
( run in 1.341 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )