You are here

public function HttpConfigRequest::execute in HTTP Client Manager 8

Same name and namespace in other branches
  1. 8.2 src/Entity/HttpConfigRequest.php \Drupal\http_client_manager\Entity\HttpConfigRequest::execute()

Executes configured Http Request.

Return value

mixed The command response.

File

src/Entity/HttpConfigRequest.php, line 96

Class

HttpConfigRequest
Defines the Http Config Request entity.

Namespace

Drupal\http_client_manager\Entity

Code

public function execute() {
  $factory = \Drupal::service('http_client_manager.factory');
  $client = $factory
    ->get($this
    ->get('service_api'));
  $params = $this
    ->getParameters();
  return $client
    ->call($this
    ->get('command_name'), $this
    ->replaceTokens($params));
}