コード例 #1
0
ファイル: Api.php プロジェクト: double-opt-in/php-client-api
 /**
  * get all actions
  *
  * @param ClientCommand $command
  *
  * @return Response|CommandResponse|DecryptedCommandResponse|StatusResponse
  */
 public function send(ClientCommand $command)
 {
     $request = $this->client->createRequest($command->method(), $this->client->getBaseUrl() . $command->uri($this->cryptographyEngine), $this->headers($command->apiVersion(), $command->format(), $command->headers()), $command->body($this->cryptographyEngine), $this->config->getHttpClientConfig());
     try {
         $response = $request->send();
     } catch (ClientErrorResponseException $exception) {
         $response = $exception->getResponse();
     } catch (ServerErrorResponseException $exception) {
         $response = $exception->getResponse();
     }
     return $command->response($response, $this->cryptographyEngine);
 }