lib/Client/FileGetContents.php
protected function getStreamContextArray(RequestInterface $request, ParameterBag $options): array
    {
        $headers = $request->getHeaders();
        unset($headers['Host']);
        $context = [
            'http' => [
                // values from the request
                'method' => $request->getMethod(),
                'header' => implode("\r\n", HeaderConverter::toBuzzHeaders($headers)),
                'content' => $request->getBody()->__toString(),
                'protocol_version' => $request->getProtocolVersion(),

                // values from the current client
                'ignore_errors' => true,
                'follow_location' => $options->get('allow_redirects') && $options->get('max_redirects') > 0,
                'max_redirects' => $options->get('max_redirects') + 1,
            ],
            'ssl' => [
                'verify_peer' => $options->get('verify'),
                'verify_host' => $options->get('verify'),
            ],
        ];

        if (0 < $options->get('timeout')) {
            $context['http']['timeout'] = $options->get('timeout');
        }

        if (null !== $options->get('proxy')) {
            $context['http']['proxy'] = $options->get('proxy');
            $context['http']['request_fulluri'] = true;
        }

        return $context;
    }
protected function getStreamContextArray(RequestInterface $request, ParameterBag $options): array
    {
        $headers = $request->getHeaders();
        unset($headers['Host']);
        $context = [
            'http' => [
                // values from the request
                'method' => $request->getMethod(),
                'header' => implode("\r\n", HeaderConverter::toBuzzHeaders($headers)),
                'content' => $request->getBody()->__toString(),
                'protocol_version' => $request->getProtocolVersion(),

                // values from the current client
                'ignore_errors' => true,
                'follow_location' => $options->get('allow_redirects') && $options->get('max_redirects') > 0,
                'max_redirects' => $options->get('max_redirects') + 1,
            ],
            'ssl' => [
                'verify_peer' => $options->get('verify'),
                'verify_host' => $options->get('verify'),
            ],
        ];

        if (0 < $options->get('timeout')) {
            $context['http']['timeout'] = $options->get('timeout');
        }

        if (null !== $options->get('proxy')) {
            $context['http']['proxy'] = $options->get('proxy');
            $context['http']['request_fulluri'] = true;
        }

        return $context;
    }
Converts a request into an array for stream_context_create().

@param RequestInterface $request A request object

@return array An array for stream_context_create()