Classes/Service/ClientService.php
public function runSingleRequest(string $url): int
    {
        try {
            $host = \parse_url($url, PHP_URL_HOST);
            if (false === $host) {
                throw new \Exception('No host in cache_url', 1263782);
            }
            $client = $this->getCallableClient($host);
            $response = $client->get($url);

            return (int)$response->getStatusCode();
        } catch (\Exception $exception) {
            $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__);
            $logger->error('Problems in single request running: ' . $exception->getMessage() . ' / ' . $exception->getFile() . ':' . $exception->getLine());
        }

        return 900;
    }
public function runSingleRequest(string $url): int
    {
        try {
            $host = \parse_url($url, PHP_URL_HOST);
            if (false === $host) {
                throw new \Exception('No host in cache_url', 1263782);
            }
            $client = $this->getCallableClient($host);
            $response = $client->get($url);

            return (int)$response->getStatusCode();
        } catch (\Exception $exception) {
            $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__);
            $logger->error('Problems in single request running: ' . $exception->getMessage() . ' / ' . $exception->getFile() . ':' . $exception->getLine());
        }

        return 900;
    }
public function runSingleRequest ( string $ url ) : int { try { $ host = \ parse_url ( $ url , PHP_URL_HOST ) ; if ( false === $ host ) { throw new \ Exception ( 'No host in cache_url' , 1263782 ) ; } $ client = $ this -> getCallableClient ( $ host ) ; $ response = $ client -> get ( $ url ) ; return ( int ) $ response -> getStatusCode ( ) ; } catch ( \ Exception $ exception ) { $ logger = GeneralUtility :: makeInstance ( LogManager :: class ) -> getLogger ( __CLASS__ ) ; $ logger -> error ( 'Problems in single request running: ' . $ exception -> getMessage ( ) . ' / ' . $ exception -> getFile ( ) . ':' . $ exception -> getLine ( ) ) ; } return 900 ; }
Run a single request with guzzle and return status code.

@param string $url

@return int
Run a single request with guzzle and return status code .