/** * {@inheritdoc} */ public function delete($url, array $headers = array()) { $response = $this->browser->delete($url, $headers); if (!$response->isSuccessful()) { throw $this->handleResponse($response); } }
public function deleteRecord($table, array $criteria = []) { $record = $this->findRecord($table, $criteria); /** @var Response $response */ $response = $this->browser->delete($this->getEndpoint($table, $record->getId()), ["content-type" => "application/json"]); $this->guardResponse($table, $response); }
/** * Common delete request for all API calls * * @param string $resource The path to the resource wanted. For example v2/room * * @return array Decoded array containing response * @throws Exception\RequestException */ public function delete($resource) { $url = $this->baseUrl . $resource; $headers = array('Authorization' => $this->auth->getCredential()); $response = $this->browser->delete($url, $headers); if ($this->browser->getLastResponse()->getStatusCode() > 299) { throw new RequestException(json_decode($this->browser->getLastResponse()->getContent(), true)); } return json_decode($response->getContent(), true); }
/** * {@inheritdoc} */ public function delete($url) { $response = $this->browser->delete($url); $this->handleResponse($response); }