public function RequestService::request in Entity Share 8.2
Performs a HTTP request. Wraps the Guzzle HTTP client.
Why wrap the Guzzle HTTP client? Because we want to be able to override this service during tests to emulate another website.
Parameters
\GuzzleHttp\Client $http_client: The HTTP client.
string $method: HTTP method.
string $url: URL to request.
Return value
\Psr\Http\Message\ResponseInterface The response.
Overrides RequestServiceInterface::request
See also
\GuzzleHttp\ClientInterface::request()
1 call to RequestService::request()
- TestRequestService::request in modules/
entity_share_client/ tests/ modules/ entity_share_client_request_test/ src/ Service/ TestRequestService.php - Performs a HTTP request. Wraps the Guzzle HTTP client.
1 method overrides RequestService::request()
- TestRequestService::request in modules/
entity_share_client/ tests/ modules/ entity_share_client_request_test/ src/ Service/ TestRequestService.php - Performs a HTTP request. Wraps the Guzzle HTTP client.
File
- modules/
entity_share_client/ src/ Service/ RequestService.php, line 19
Class
- RequestService
- Class RequestService.
Namespace
Drupal\entity_share_client\ServiceCode
public function request(Client $http_client, $method, $url) {
return $http_client
->request($method, $url);
}