/** * Execute DELETE request. * * @param string $path * @param array $binds * * @return Response */ public function delete($path, $binds = null) { $httpRequest = $this->prepare('DELETE', $path, $binds); try { $httpResponse = $httpRequest->send(); } catch (BadResponseException $exc) { $httpResponse = $exc->getResponse(); } $json = $httpResponse->json(); $response = new Response(); $response->setStatus($json['status']); $response->setError($json['error']); if (isset($json['data']['items'])) { $response->setData($json['data']['items']); } else { $response->setData($json['data']); } return $response; }