NAME

Data::URIID::Request - Extractor for identifiers from URIs

VERSION

version v0.26

SYNOPSIS

use Data::URIID::Request;

(experimental since v0.26)

This package inherits from Data::Identifier::Interface::Userdata (since v0.26).

METHODS

attribute

my $value  = $request->attribute($key [, %opts ] );
# or:
my @values = $request->attribute($key [, %opts ], list => 1 );

(experimental since v0.26)

This returns a value from the request. The type of returned value depend on the given key and options.

If the key is unknown or no value is present this method will die.

The following attributes are defined. Not all of them are available for all requests.

actual_url

(experimental since v0.26)

If the request is to an external service the actual URL that was queried. This can be a local file.

online

(experimental since v0.26)

Whether the request was an online request. Note that the same result can include online and offline requests.

pass

(experimental since v0.26)

The pass number in which the request happened. This might not be defined if the request was made outside the multipass body, such as a warmup request. Which numbers can be returned is not defined. However larger numbers mean later.

request_url

(experimental since v0.26)

The initial URL that was requested (before any overrides or redirects).

result

(experimental since v0.26)

The result (see Data::URIID::Result) for which this is an request.

service

(experimental since v0.26)

The service (see Data::URIID::Service) which was queried.

The following, all optional, options are supported:

default

Returns the given value if no value is found. This can also be set to undef to allow returning undef in case of no value found instead of die-ing.

no_defaults

(ignored)

list

Returns the value as a list. When not in list mode, there must be exactly one value, otherwise this method will die.

as

The type to return the value in. This is implemented via "as" in Data::Identifier.

AUTHOR

Philipp Schafft <lion@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2023-2026 by Philipp Schafft <lion@cpan.org>.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)