/**
* @see HttpClientInterface::OPTIONS_DEFAULTS for available options
*/
public function request(string
$method, string
$url, array
$options =
[]): ResponseInterface
{ [$url,
$options] = self::
prepareRequest($method,
$url,
$options,
$this->defaultOptions
);
$scheme =
$url['scheme'
];
$authority =
$url['authority'
];
$host =
parse_url($authority, \PHP_URL_HOST
);
$port =
parse_url($authority, \PHP_URL_PORT
) ?:
('http:' ===
$scheme ? 80 : 443
);
$proxy = self::
getProxyUrl($options['proxy'
],
$url);
$url =
implode('',
$url);
if (!
isset($options['normalized_headers'
]['user-agent'
])) { $options['headers'
][] = 'User-Agent: Symfony HttpClient (Curl)';
} $curlopts =
[ \CURLOPT_URL =>
$url,
\CURLOPT_TCP_NODELAY => true,
\CURLOPT_PROTOCOLS => \CURLPROTO_HTTP | \CURLPROTO_HTTPS,
\CURLOPT_REDIR_PROTOCOLS => \CURLPROTO_HTTP | \CURLPROTO_HTTPS,