Joli\Jane\OpenApi\Tests\Expected\Resource\TestResource::headTest PHP Method

headTest() public method

public headTest ( array $parameters = [], string $fetch = self::FETCH_OBJECT ) : Psr\Http\Message\ResponseInterface
$parameters array List of parameters
$fetch string Fetch mode (object or response)
return Psr\Http\Message\ResponseInterface
    public function headTest($parameters = [], $fetch = self::FETCH_OBJECT)
    {
        $queryParam = new QueryParam();
        $url = '/test-get';
        $url = $url . ('?' . $queryParam->buildQueryString($parameters));
        $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
        $body = $queryParam->buildFormDataString($parameters);
        $request = $this->messageFactory->createRequest('HEAD', $url, $headers, $body);
        $promise = $this->httpClient->sendAsyncRequest($request);
        if (self::FETCH_PROMISE === $fetch) {
            return $promise;
        }
        $response = $promise->wait();
        return $response;
    }