本文整理汇总了PHP中Guzzle\Http\ClientInterface::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP ClientInterface::delete方法的具体用法?PHP ClientInterface::delete怎么用?PHP ClientInterface::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Guzzle\Http\ClientInterface
的用法示例。
在下文中一共展示了ClientInterface::delete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteMessages
/**
* {@inheritdoc}
*/
public function deleteMessages()
{
try {
$this->guzzle->delete('/messages')->send();
} catch (GuzzleException $e) {
throw new ConnectionException("", 0, $e);
}
}
示例2: delete
/**
* {@inheritdoc}
*/
public function delete($url)
{
try {
$this->response = $this->client->delete($url)->send();
} catch (RequestException $e) {
$this->response = $e->getResponse();
$this->handleError();
}
return $this->response->getBody(true);
}
示例3: deletePlaylistById
/**
* Delete a playlist by ID
*
* @param int $playlistId
*
* @return array
*/
public function deletePlaylistById($playlistId)
{
$params = $this->baseParams + array('playlist_id' => $playlistId);
$params['signature'] = $this->generateSignature($params);
unset($params['playlist_id']);
$query = $this->buildQueryString($params);
$request = $this->httpClient->delete('playlists/' . $playlistId . $query);
$response = $request->send();
return $response->getStatusCode() === 204;
}
示例4: delete
/**
* {@inheritDoc}
*/
public function delete($path, $body = null, array $parameters = array(), array $headers = array())
{
$parameters = $this->buildQueryParameters($parameters);
return $this->request($this->client->delete($path, $headers, $body, $parameters));
}
示例5:
function it_format_body_to_a_valid_form_urlencod_request(ClientInterface $client, RequestInterface $request)
{
$client->delete('/resource?foo=bar', ['Content-Type' => 'application/x-www-form-urlencoded'], 'foo=bar&baz=plop', ['some options'])->shouldBeCalled(1)->willReturn($request);
$this->setClient($client);
$this->build('/resource', ['foo' => 'bar'], null, null, ['foo' => 'bar', 'baz' => 'plop'], ['some options'])->shouldReturn($request);
}
示例6: delete
/**
* {@inheritdoc}
*/
public function delete($url, array $headers = array())
{
$this->response = $this->client->delete($url, $headers)->send();
return $this->response->getBody(true);
}