private function prepareHeadersForStreamContext(array $headers): string
    {
        return implode("\r\n", array_map(function (string $name, string $value) {
            return $name . ': ' . $value;
        }, array_keys($headers), $headers));
    }