Send a DELETE request

@param  string $uri                The uri to call in the service
@param  array $headers             The http headers
@return bool                       True for success
357352
public function delete(string $uri, array $headers=[])
  {
    $this->sendRequest($this->createRequest('DELETE',$uri), $headers);

    return !is_null($this->getResponse());
  }
299080
public function head(string $uri)
    {
        $request = $this->getRequest($uri)
            ->setMethod('HEAD');

        return $this->send($request);
    }
1155852
private function sendRequest($endpoint, $headers = array())
    {
        $method = strtolower($this->config[$endpoint]['method']);

        if (! in_array($method, array('get', 'post', 'put', 'delete'))) {
            throw new \Exception(sprintf('%s method must be GET, POST, PUT, or DELETE', $endpoint));
        }

        if (isset($this->config['auth'])) {
            $response = $this->client->request(
                $method,
                $this->config[$endpoint]['path'],
                [
                    'auth' => [$this->config['auth']['user'], $this->config['auth']['password']],
                    'headers' => $headers,
                ]
            );
        } else {
            $response = $this->client->request(
                $method,
                $this->config[$endpoint]['path'],
                [
                    'headers' => $headers,
                ]
            );
        }

        return $response;
    }
453829
public function delete($uri,array $headers,$body)
        {
            return $this->prepareRequest(self::DELETE,$uri,$headers,$body);
        }
819934
public function delete(string $url, array $params = []): HttpResponse
    {
        return $this->send('DELETE', $url, [
            $this->bodyFormat => $params,
        ]);
    }
944963
public function request(string $uri, string $method = null, array $query = null, $body = null, array $headers = null):ResponseInterface{
		$method    = \strtoupper($method ?? 'GET');
		$headers   = Psr7\normalize_request_headers($headers);
		$request   = new Request($method, Psr7\merge_query($uri, $query ?? []));

		if(\in_array($method, ['DELETE', 'PATCH', 'POST', 'PUT'], true) && $body !== null){

			if(\is_array($body) || \is_object($body)){

				if(!isset($headers['Content-type'])){
					$headers['Content-type'] = 'application/x-www-form-urlencoded';
				}

				if($headers['Content-type'] === 'application/x-www-form-urlencoded'){
					$body = \http_build_query($body, '', '&', \PHP_QUERY_RFC1738);
				}
				elseif($headers['Content-type'] === 'application/json'){
					$body = \json_encode($body);
				}
				else{
					$body = null; // @todo
				}

			}

			$request = $request->withBody(Psr17\create_stream((string)$body));
		}

		foreach($headers as $header => $value){
			$request = $request->withAddedHeader($header, $value);
		}

		return $this->sendRequest($request);
	}
53222
public function delete($uri, $content = null, $requestHeaders = array()) {
        try {
            return $this->executeDelete($uri, $content, $requestHeaders);
        } catch (Unauthenticated $e) {
            $this->auth_token->reset();
            return $this->executeDelete($uri, $content, $requestHeaders);
        }
    }
244825
public function put($url, $headers = [], $body = null)
    {
        return $this->send(Method::PUT, $url, $body, $headers);
    }
510489
protected function sendRequest(string $method = 'PURGE', string $uri, array $headers = [])
    {
        $client = new Client([
            'base_uri' => self::API_ENDPOINT,
            'headers'  => array_merge($headers, [
                'Content-Type' => 'application/json',
                'Fastly-Key'   => $this->apiToken
            ])
        ]);

        // Prepend the service endpoint
        if (in_array($method, ['POST','GET'])) {
            $uri = "service/{$this->serviceId}/{$uri}";
        }

        try {

            $client->request($method, $uri);

        } catch (BadResponseException $e) {

            throw FastlyApiException::create(
                $e->getRequest(),
                $e->getResponse()
            );
        }

        return true;
    }
528864
protected function delete($url, array $headers)
    {
        $request = [
            'headers' => array_merge(
                ['Content-Type' => 'application/json'],
                $headers
            ),
            'exceptions' => false,
        ];

        $this->request('delete', $url, $request);
    }
279683
public function delete(string $route, $body = [], $headers = [])
    {
        return $this->request('DELETE', $route, $body, $headers);
    }
100600
public static function delete($url, $httpHeaders = array())
    {
        self::prepareRequest($httpHeaders);

        $response = CurlRequest::delete($url, self::$httpHeaders);

        return self::processResponse($response);
    }
1155612
public function sendHeaders(HeaderBag $headers)
    {
        header_remove();

        foreach ($headers->get() as $header)
        {
            header(
                (string) $header,
                false
            );
        }
    }
476991
public function delete(string $uri)
    {
        $request = $this->getRequest($uri)
            ->setMethod('DELETE');

        return $this->send($request);
    }
587369
public function getResource(
        $uri = "",
        $headers = []
    ) {
        // Set headers
        $options = ['http_errors' => false, 'headers' => $headers];

        // Send the request.
        return $this->client->request(
            'GET',
            $uri,
            $options
        );
    }
489500
protected void executeDeleteRequest(URI uri, Map<String, Object> headers, 
        List<String> queryParams)
    {
        WebTarget target = this.client.target(uri);
        target = applyQueryParams(target, queryParams);
        Invocation.Builder invocation = target.request(MediaType.APPLICATION_JSON);
        applyHeaders(invocation, headers);
        Response response = invocation.delete();
        handleResponseError("DELETE", uri, response);
        logResponse(uri, response);
    }
853313
public static function deleteObject($bucket, $uri)
	{
		$rest = new S3Request('DELETE', $bucket, $uri, self::$endpoint);
		$rest = $rest->getResponse();
		if ($rest->error === false && $rest->code !== 204)
			$rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
		if ($rest->error !== false)
		{
			self::__triggerError(sprintf("S3::deleteObject(): [%s] %s",
			$rest->error['code'], $rest->error['message']), __FILE__, __LINE__);
			return false;
		}
		return true;
	}