public function httpHead(RequestInterface $request, ResponseInterface $response)
    {
        // This is implemented by changing the HEAD request to a GET request,
        // and telling the request handler that is doesn't need to create the body.
        $subRequest = clone $request;
        $subRequest->setMethod('GET');
        $subRequest->setHeader('X-Sabre-Original-Method', 'HEAD');

        try {
            $this->server->invokeMethod($subRequest, $response, false);
        } catch (Exception\NotImplemented $e) {
            // Some clients may do HEAD requests on collections, however, GET
            // requests and HEAD requests _may_ not be defined on a collection,
            // which would trigger a 501.
            // This breaks some clients though, so we're transforming these
            // 501s into 200s.
            $response->setStatus(200);
            $response->setBody('');
            $response->setHeader('Content-Type', 'text/plain');
            $response->setHeader('X-Sabre-Real-Status', $e->getHTTPCode());
        }

        // Sending back false will interrupt the event chain and tell the server
        // we've handled this method.
        return false;
    }
public function httpHead(RequestInterface $request, ResponseInterface $response)
    {
        // This is implemented by changing the HEAD request to a GET request,
        // and telling the request handler that is doesn't need to create the body.
        $subRequest = clone $request;
        $subRequest->setMethod('GET');
        $subRequest->setHeader('X-Sabre-Original-Method', 'HEAD');

        try {
            $this->server->invokeMethod($subRequest, $response, false);
        } catch (Exception\NotImplemented $e) {
            // Some clients may do HEAD requests on collections, however, GET
            // requests and HEAD requests _may_ not be defined on a collection,
            // which would trigger a 501.
            // This breaks some clients though, so we're transforming these
            // 501s into 200s.
            $response->setStatus(200);
            $response->setBody('');
            $response->setHeader('Content-Type', 'text/plain');
            $response->setHeader('X-Sabre-Real-Status', $e->getHTTPCode());
        }

        // Sending back false will interrupt the event chain and tell the server
        // we've handled this method.
        return false;
    }
public function httpHead ( RequestInterface $ request , ResponseInterface $ response ) { // This is implemented by changing the HEAD request to a GET request, // and telling the request handler that is doesn't need to create the body. $ subRequest = clone $ request ; $ subRequest -> setMethod ( 'GET' ) ; $ subRequest -> setHeader ( 'X-Sabre-Original-Method' , 'HEAD' ) ; try { $ this -> server -> invokeMethod ( $ subRequest , $ response , false ) ; } catch ( Exception \ NotImplemented $ e ) { // Some clients may do HEAD requests on collections, however, GET // requests and HEAD requests _may_ not be defined on a collection, // which would trigger a 501. // This breaks some clients though, so we're transforming these // 501s into 200s. $ response -> setStatus ( 200 ) ; $ response -> setBody ( '' ) ; $ response -> setHeader ( 'Content-Type' , 'text/plain' ) ; $ response -> setHeader ( 'X-Sabre-Real-Status' , $ e -> getHTTPCode ( ) ) ; } // Sending back false will interrupt the event chain and tell the server // we've handled this method. return false ; }
HTTP HEAD.

This method is normally used to take a peak at a url, and only get the
HTTP response headers, without the body. This is used by clients to
determine if a remote file was changed, so they can use a local cached
version, instead of downloading it again

@param RequestInterface  $request
@param ResponseInterface $response

@return bool
HTTP HEAD .