function ResourceFetcherInterface::fetchResource

Same name in other branches
  1. 8.9.x core/modules/media/src/OEmbed/ResourceFetcherInterface.php \Drupal\media\OEmbed\ResourceFetcherInterface::fetchResource()
  2. 10 core/modules/media/src/OEmbed/ResourceFetcherInterface.php \Drupal\media\OEmbed\ResourceFetcherInterface::fetchResource()
  3. 11.x 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);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.