title: How to use PHP cURL with HTTP/1.1
body: <p>My server cURL version is newer then client's version when doing remote call, client's server automatically switches to http/2, Is there any way i can force to use curl with http/1.1</p>
  <p>How to set cURL HTTP version to 1.1, I tested by adding following settings in code, but after adding that curl stops working. All kind of helps are appreciable. Thanks in advance.</p>
  <pre><code> curl_setopt($ch, CURLOPT_HTTP_VERSION, '1.1');
   curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
  </code></pre>
  <p>Is there any way i can use curl with HTTP 1.1 ?</p>
  <p>My server versions are</p>
  <p>PHP Version 7.2.16</p>
  <p>cURL Information    7.62.0</p>
  <pre><code>$ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_ENCODING, &quot;&quot;);
  curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  
  //curl_setopt($ch, CURLOPT_HTTP_VERSION, '1.1');
  //curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
  
  curl_setopt($ch, CURLOPT_USERPWD, $user . ':' . $pass);
  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)');
  curl_setopt($ch, CURLOPT_TIMEOUT, 2400);  */
  curl_setopt($ch,CURLOPT_HTTPHEADER, array(
     //  &quot;http:1.1&quot;,
    'http' =&gt; array(
       'timeout' =&gt; 5,
       'protocol_version' =&gt; 1.1,
       'header' =&gt; 'Connection: close'
     ),
     &quot;Content-Type: text/event-stream&quot;,
     &quot;cache-control:no-cache&quot;,
     &quot;Access-Control-Allow-Origin:*&quot;,
     'Authorization: Basic '. base64_encode($user.':'.$pass)
   ));
  
  
   $error  = 0;
   $result = curl_exec($ch);
   $info  = curl_getinfo($ch);
   $err   = curl_errno($ch);
  </code></pre>
  <p>Client's tech team reply : Problem is -&gt; You starts with version 1.1 then it changes to version 2</p>
  <p>Using HTTP2, server supports multi-use</p>
  <p>Connection state changed (HTTP/2 confirmed)</p>