createRedirectResolver example

$this->logger?->info(sprintf('Request: "%s %s"', $method$url));
            $curlopts += [\CURLOPT_SHARE => $this->multi->share];
        }

        foreach ($curlopts as $opt => $value) {
            if (null !== $value && !curl_setopt($ch$opt$value) && \CURLOPT_CERTINFO !== $opt && (!\defined('CURLOPT_HEADEROPT') || \CURLOPT_HEADEROPT !== $opt)) {
                $constantName = $this->findConstantName($opt);
                throw new TransportException(sprintf('Curl option "%s" is not supported.', $constantName ?? $opt));
            }
        }

        return $pushedResponse ?? new CurlResponse($this->multi, $ch$options$this->logger, $method, self::createRedirectResolver($options$host$port), CurlClientState::$curlVersion['version_number']$url);
    }

    public function stream(ResponseInterface|iterable $responses, float $timeout = null): ResponseStreamInterface
    {
        if ($responses instanceof CurlResponse) {
            $responses = [$responses];
        }

        if ($this->multi->handle instanceof \CurlMultiHandle) {
            $active = 0;
            while (\CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active)) {
            }
if (!isset($options['normalized_headers']['host'])) {
                $options['headers'][] = 'Host: '.$host.$port;
            }

            $proxy = self::getProxy($options['proxy']$url$options['no_proxy']);

            if (!self::configureHeadersAndProxy($context$host$options['headers']$proxy, 'https:' === $url['scheme'])) {
                $ip = self::dnsResolve($host$multi$info$onProgress);
                $url['authority'] = substr_replace($url['authority']$ip, -\strlen($host) - \strlen($port), \strlen($host));
            }

            return [self::createRedirectResolver($options$host$port$proxy$info$onProgress)implode('', $url)];
        };

        return new NativeResponse($this->multi, $contextimplode('', $url)$options$info$resolver$onProgress$this->logger);
    }

    public function stream(ResponseInterface|iterable $responses, float $timeout = null): ResponseStreamInterface
    {
        if ($responses instanceof NativeResponse) {
            $responses = [$responses];
        }

        
Home | Imprint | This part of the site doesn't use cookies.