Deletes the resource or the resource list

@param \Psr\Http\Message\ServerRequestInterface $request Request object
@param \Psr\Http\Message\ResponseInterface $response Response object
@return \Psr\Http\Message\ResponseInterface Modified response object
330094
public function delete( ServerRequestInterface $request, ResponseInterface $response )
	{
		return $this->client->delete( $request, $response );
	}
493708
public function deleteAction(Request $request)
    {
        $this->mapper->delete($this->mapper->getResource($request->get('id')));

        return new Response('', 204);
    }
238006
protected function createRevalidationRequest(RequestInterface $request, Response $response)
    {
        $revalidate = clone $request;
        $revalidate->removeHeader('Pragma')->removeHeader('Cache-Control');

        if ($response->getLastModified()) {
            $revalidate->setHeader('If-Modified-Since', $response->getLastModified());
        }

        if ($response->getEtag()) {
            $revalidate->setHeader('If-None-Match', $response->getEtag());
        }

        // Remove any cache plugins that might be on the request to prevent infinite recursive revalidations
        $dispatcher = $revalidate->getEventDispatcher();
        foreach ($dispatcher->getListeners() as $eventName => $listeners) {
            foreach ($listeners as $listener) {
                if (is_array($listener) && $listener[0] instanceof CachePlugin) {
                    $dispatcher->removeListener($eventName, $listener);
                }
            }
        }

        return $revalidate;
    }
463200
public function executeFilters(Request $request, Response $response)
    {
        $middlewares = $this->filterMiddleware(Filter::class);

        foreach ($middlewares as $middleware) {
            if (($returnResponse = $middleware->doFilter($request, $response)) !== null) {
                return $returnResponse;
            }
            unset($returnResponse);
        }

        unset($middlewares);
    }
1044093
protected function _handleCallbackAction(ServerRequest $request, Response $response)
    {
        $this->_setupModelInstances();

        $config = $this->getConfig();
        $providerName = $request->getParam('provider');

        $profile = $this->_getProfile($providerName, $request);
        if (!$profile) {
            return $response->withLocation(
                Router::url($config['loginUrl'], true) . '?error=' . $this->_error
            );
        }

        $user = $this->_getUser($profile);
        if (!$user) {
            return $response->withLocation(
                Router::url($config['loginUrl'], true) . '?error=' . $this->_error
            );
        }

        $user->unsetProperty($config['fields']['password']);

        if (!$config['userEntity']) {
            $user = $user->toArray();
        }

        $event = $this->dispatchEvent(self::EVENT_AFTER_IDENTIFY, ['user' => $user]);
        $result = $event->getResult();
        if ($result !== null) {
            $user = $event->getResult();
        }

        $request->getSession()->write($config['sessionKey'], $user);

        return $response->withLocation(
            Router::url($this->_getRedirectUrl($request), true)
        );
    }
1201240
public function fromResponse(RequestInterface $request, Response $response)
	{
		$message = $response->json();

		$parts = array(
			'type' => isset($message['error']) ? $message['error'] : null,
			'description' => isset($message['description']) ? $message['description'] : null,
			'request_id' => $response->getHeaders()->get('x-kinvey-request-id'),
			'debug' => isset($message['debug']) && !empty($message['debug']) ? $message['debug'] : null,
		);

		return $this->createException($request, $response, $parts);
	}
731932
private function defaultErrorHandler(
        ServerRequestInterface $request,
        ResponseInterface $response
    ) {
        $response = $response->withStatus(422, 'Unprocessable Entity')
            ->withHeader('Content-Type', 'application/json');

        $middlewareAttribute = $request->getAttribute(Middleware::KEY, []);

        if (isset($middlewareAttribute[self::KEY])) {
            /** @var ResponseInterface $response */
            $stream = $response->getBody();
            $stream->write(json_encode($middlewareAttribute[self::KEY], JSON_UNESCAPED_SLASHES));
        }

        return $response;
    }
1030008
public function handle(
        ServerRequestInterface $request, ResponseInterface $response
    )
    {
        $this->request = $request;
        $render = $this->request->getAttribute('render', true);
        if ($render) {
            $response = $this->render($response);
        }
        return $this->executeNext($request, $response);
    }
31633
public function delete( ServerRequestInterface $request, ResponseInterface $response )
	{
		$view = $this->getView();

		try
		{
			$response = $this->deleteItems( $view, $request, $response );
			$status = 200;
		}
		catch( \Aimeos\Admin\JsonAdm\Exception $e )
		{
			$status = $e->getCode();
			$view->errors = array( array(
				'title' => $this->getContext()->getI18n()->dt( 'admin/jsonadm', $e->getMessage() ),
				'detail' => $e->getTraceAsString(),
			) );
		}
		catch( \Aimeos\MShop\Exception $e )
		{
			$status = 404;
			$view->errors = array( array(
				'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ),
				'detail' => $e->getTraceAsString(),
			) );
		}
		catch( \Exception $e )
		{
			$status = 500;
			$view->errors = array( array(
				'title' => $e->getMessage(),
				'detail' => $e->getTraceAsString(),
			) );
		}

		/** admin/jsonadm/standard/template-delete
		 * Relative path to the JSON API template for DELETE requests
		 *
		 * The template file contains the code and processing instructions
		 * to generate the result shown in the JSON API body. The
		 * configuration string is the path to the template file relative
		 * to the templates directory (usually in admin/jsonadm/templates).
		 *
		 * You can overwrite the template file configuration in extensions and
		 * provide alternative templates. These alternative templates should be
		 * named like the default one but with the string "standard" replaced by
		 * an unique name. You may use the name of your project for this. If
		 * you've implemented an alternative client class as well, "standard"
		 * should be replaced by the name of the new class.
		 *
		 * @param string Relative path to the template creating the body for the DELETE method of the JSON API
		 * @since 2015.12
		 * @category Developer
		 * @see admin/jsonadm/standard/template-aggregate
		 * @see admin/jsonadm/standard/template-get
		 * @see admin/jsonadm/standard/template-patch
		 * @see admin/jsonadm/standard/template-post
		 * @see admin/jsonadm/standard/template-put
		 * @see admin/jsonadm/standard/template-options
		 */
		$tplconf = 'admin/jsonadm/standard/template-delete';
		$default = 'delete-standard';

		$body = $view->render( $view->config( $tplconf, $default ) );

		return $response->withHeader( 'Content-Type', 'application/vnd.api+json; supported-ext="bulk"' )
			->withBody( $view->response()->createStreamFromString( $body ) )
			->withStatus( $status );
	}
175152
public function terminate(Request $request, Response $response)
    {
        $this->settings->save();

        $unused = compact('request', 'response');
        unset($unused);
    }
239864
protected function routeToErrorPage(ServerRequestInterface $request, ResponseInterface $response)
    {
        $errorRoute = $this->getErrorRoute($request, $response);
        
        if (!isset($errorRoute)) {
            return $response;
        }
        
        $runner = $this->router->getRunner();
        
        return $runner($request->withAttribute('route', $errorRoute), $response);
    }
1368678
public function destroy(Request $request, $id)
    {
        $forceDelete = $request->get('force', false);

        $block = $this->repository->getByIdWithTrashed($id);

        if (!empty($block)) {
            $this->authorize('delete', $block);
            if ($forceDelete) {
                $this->repository->forceDelete($block);
            } else {
                $this->repository->delete($block);
            }
            return $this->respondWithSimpleSuccess(['success' => true]);
        }
        return $this->respondNotFound();
    }
368507
public function deleteAction(Request $request)
    {
        $siterootId = $request->get('id');

        $siterootManager = $this->get('phlexible_siteroot.siteroot_manager');

        $siteroot = $siterootManager->find($siterootId);
        $siterootManager->deleteSiteroot($siteroot);

        return new ResultResponse(true, 'Siteroot deleted.');
    }
801059
public function response(ServerRequestInterface $request, ResponseInterface $response)
    {
        // Demo contents
        $contents = 'It works!';

        // Write Response to Body
        $response->getBody()->write($contents);

        // PSR-7 response
        return $response;
    }
553511
public function httpDelete(RequestInterface $request, ResponseInterface $response)
    {
        $path = $request->getPath();

        if (!$this->server->emit('beforeUnbind', [$path])) {
            return false;
        }
        $this->server->tree->delete($path);
        $this->server->emit('afterUnbind', [$path]);

        $response->setStatus(204);
        $response->setHeader('Content-Length', '0');

        // Sending back false will interrupt the event chain and tell the server
        // we've handled this method.
        return false;
    }
455091
public function terminate(Request $request, Response $response)
    {
        $event = new PostResponseEvent($this, $request, $response);
        $this->getDispatcher()->dispatch(KernelEvents::TERMINATE, $event);
    }
1298696
public function shutdown($request, $response)
    {
        $routeMiddlewares = $this->router->getMiddlewares();

        $middlewares = array_merge(array_filter([$routeMiddlewares]), $this->getMiddleware());

        foreach ($middlewares as $middleware) {
            list($name, $parameters) = $this->pipeline->parsePipeString($middleware);

            $instance = $this->container->make($name);

            if (method_exists($instance, 'shutdown')) {
                $instance->shutdown($request, $response);
            }
        }
    }