Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function deleteMessages()
 {
     try {
         $this->guzzle->delete('/messages')->send();
     } catch (GuzzleException $e) {
         throw new ConnectionException("", 0, $e);
     }
 }
Exemplo n.º 2
0
 /**
  * {@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);
 }
Exemplo n.º 3
0
 /**
  * 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;
 }
Exemplo n.º 4
0
 /**
  * {@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));
 }
 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);
 }
Exemplo n.º 6
0
 /**
  * {@inheritdoc}
  */
 public function delete($url, array $headers = array())
 {
     $this->response = $this->client->delete($url, $headers)->send();
     return $this->response->getBody(true);
 }