get method

Resource? get(
  1. Link link
)

A service can return a Resource to:

  • respond to a request to its web API declared in links,
  • serve additional resources on behalf of the publication,
  • replace a publication resource by its own version.

Called by Publication.get for each request.

Warning: If you need to request one of the publication resources to answer the request, use the Fetcher provided by the PublicationServiceContext instead of Publication.get, otherwise it will trigger an infinite loop.

@return The Resource containing the response, or null if the service doesn't recognize this request.

Implementation

Resource? get(Link link) => null;