You are here

public function RemoteManager::request in Entity Share 8.3

Performs a HTTP request. Wraps the HTTP client.

We need to override this method during tests to emulate another website.

Parameters

\Drupal\entity_share_client\Entity\RemoteInterface $remote: The remote website on which to perform the request.

string $method: HTTP method.

string $url: URL to request.

Return value

\Psr\Http\Message\ResponseInterface The response.

Overrides RemoteManagerInterface::request

See also

\GuzzleHttp\ClientInterface::request()

File

modules/entity_share_client/src/Service/RemoteManager.php, line 79

Class

RemoteManager
Service to wrap requests logic.

Namespace

Drupal\entity_share_client\Service

Code

public function request(RemoteInterface $remote, $method, $url) {
  $client = $this
    ->getHttpClient($remote);
  return $this
    ->doRequest($client, $method, $url);
}