本文整理匯總了PHP中Buzz\Browser::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP Browser::delete方法的具體用法?PHP Browser::delete怎麽用?PHP Browser::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Buzz\Browser
的用法示例。
在下文中一共展示了Browser::delete方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: delete
/**
* {@inheritdoc}
*/
public function delete($url, array $headers = array())
{
$response = $this->browser->delete($url, $headers);
if (!$response->isSuccessful()) {
throw $this->handleResponse($response);
}
}
示例2: deleteRecord
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);
}
示例3: delete
/**
* 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);
}
示例4: delete
/**
* {@inheritdoc}
*/
public function delete($url)
{
$response = $this->browser->delete($url);
$this->handleResponse($response);
}