37 public function __construct(
string $projectKey, $body =
null, array $headers = [], ClientInterface $client =
null)
39 $uri = str_replace([
'{projectKey}'], [$projectKey],
'{projectKey}');
40 parent::__construct($client,
'HEAD', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body);
71 public function execute(array $options = [],
string $resultType =
null)
74 $response = $this->
send($options);
75 }
catch (ServerException $e) {
76 $response = $e->getResponse();
77 $e = ExceptionFactory::createServerException($e, $this, $response, $this->
mapFromResponse($response, $resultType));
79 }
catch (ClientException $e) {
80 $response = $e->getResponse();
81 $e = ExceptionFactory::createClientException($e, $this, $response, $this->
mapFromResponse($response, $resultType));
94 public function executeAsync(array $options = [],
string $resultType =
null)
97 function (ResponseInterface $response) use ($resultType) {
100 function (RequestException $e) use ($resultType) {
101 $response = $e->getResponse();
102 if ($e instanceof ServerException) {
103 $e = ExceptionFactory::createServerException($e, $this, $response, $this->
mapFromResponse($response, $resultType));
105 if ($e instanceof ClientException) {
106 $e = ExceptionFactory::createClientException($e, $this, $response, $this->
mapFromResponse($response, $resultType));