NativeResponse example

$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];
        }

        return new ResponseStream(NativeResponse::stream($responses$timeout));
    }

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