Client: DiscoveryService
Represents resource-discovery service which identify the hub
and topic
from resource-URL
.
Constructor
Initiliazes the websub:DiscoveryService
endpoint.
1websub:DiscoveryService discoveryServiceEp = check new ("https://sample.discovery.com");
init (string discoveryUrl, ClientConfiguration? config)
- discoveryUrl string
- config ClientConfiguration?
Remote Methods
discoverResourceUrls | Discovers the URLs of the hub and topic defined by a resource URL. |
discoverResourceUrls
function discoverResourceUrls(string? | string[ ] expectedMediaTypes, string? | string[ ] expectedLanguageTypes) returns [string, string] | ResourceDiscoveryFailedError
Isolated Function
Remote Function
Discovers the URLs of the hub and topic defined by a resource URL.
1[string, string] discoveryDetails = check discoveryServiceEp->discoverResourceUrls(expectedMediaTypes, expectedLanguageTypes);
Parameters
Return Type
([string, string] | ResourceDiscoveryFailedError)A (hub, topic)
as a (string, string)
if successful or else an websub:ResourceDiscoveryFailedError
if not