You are here

public function ResourceFetcherInterface::fetchResource in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/media/src/OEmbed/ResourceFetcherInterface.php \Drupal\media\OEmbed\ResourceFetcherInterface::fetchResource()

Fetches an oEmbed resource.

Parameters

string $url: Endpoint-specific URL of the oEmbed resource.

Return value

\Drupal\media\OEmbed\Resource A resource object built from the oEmbed resource data.

Throws

\Drupal\media\OEmbed\ResourceException If the oEmbed endpoint is not reachable or the response returns an unexpected Content-Type header.

See also

https://oembed.com/#section2

1 method overrides ResourceFetcherInterface::fetchResource()
ResourceFetcher::fetchResource in core/modules/media/src/OEmbed/ResourceFetcher.php
Fetches an oEmbed resource.

File

core/modules/media/src/OEmbed/ResourceFetcherInterface.php, line 30

Class

ResourceFetcherInterface
Defines an interface for an oEmbed resource fetcher service.

Namespace

Drupal\media\OEmbed

Code

public function fetchResource($url);