You are here

private function Agent::deliver in DRD Agent 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Controller/Agent.php \Drupal\drd_agent\Controller\Agent::deliver()

Callback to deliver the result of the action in json format.

Parameters

string|Response $data: The result which should be delivered back to DRD.

Return value

\Symfony\Component\HttpFoundation\Response The response to DRD.

3 calls to Agent::deliver()
Agent::authorizeBySecret in src/Controller/Agent.php
Route callback to authorize a DRD instance by a secret.
Agent::get in src/Controller/Agent.php
Route callback to execute an action and return their result.
Agent::getCryptMethods in src/Controller/Agent.php
Route callback to retrieve a list of available crypt methods.

File

src/Controller/Agent.php, line 102

Class

Agent
Class Default.

Namespace

Drupal\drd_agent\Controller

Code

private function deliver($data) : Response {
  return $data instanceof Response ? $data : new JsonResponse($data, 200, self::responseHeader());
}