ePages 7.17.0 - DE_EPAGES/WebService/API/ResourceRegistry.pm

Package DE_EPAGES::WebService::API::ResourceRegistry

Registry of REST resource handlers.

Functions

add
match

add

Adds a REST resource to the list of static handlers. This is mainly useful for writing test cases.

Syntax
DE_EPAGES::WebService::API::CodecRegistry->add($Resource);
Input
$Resource (DE_EPAGES::WebService::API::Resource::BaseResource)
REST resource

match

Finds the request handler for the given request. Throws a HandlerNotFound error if there is no handler for the request.

Syntax
$hRequestContext = DE_EPAGES::WebService::API::CodecRegistry->match($Site, $Request);
Input
$Site (DE_EPAGES::Object::API::Object::Site)
site object
$Request (HTTP::Request)
request object
Return
$hRequestContext (ref.hash)
request context,
see DE_EPAGES::WebService::API::Resource::BaseResource::requestContext