You are here

public function RemoteManager::jsonApiRequest in Entity Share 8.3

Performs a HTTP request on a JSON:API endpoint. 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::jsonApiRequest

See also

\GuzzleHttp\ClientInterface::request()

2 calls to RemoteManager::jsonApiRequest()
RemoteManager::getChannelsInfos in modules/entity_share_client/src/Service/RemoteManager.php
Get the channels infos of a remote website.
RemoteManager::getfieldMappings in modules/entity_share_client/src/Service/RemoteManager.php
Get the field mappings of a remote website.

File

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

Class

RemoteManager
Service to wrap requests logic.

Namespace

Drupal\entity_share_client\Service

Code

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