title: php cURL Error:Illegal characters found in URL
body: <p>Hi i have a problem in retrieving data from a <code>API</code> called <code>healthOs</code>.</p>
  
  <p>i'm getting </p>
  
  <blockquote>
    <p>cURL Error:Illegal characters found in URL</p>
  </blockquote>
  
  <p>here i want fetch the data using <code>PHP</code>  here is doccumentation:<a href="https://documenter.getpostman.com/view/2641261/healthos/6nATBN9#aa477f59-954c-744e-38dc-4e12a833fb70" rel="nofollow noreferrer">https://documenter.getpostman.com/view/2641261/healthos/6nATBN9#aa477f59-954c-744e-38dc-4e12a833fb70</a></p>
  
  <p><strong>i have tried this code :</strong></p>
  
  <pre><code>&lt;?php
  
  $curl = curl_init();
  
  curl_setopt_array($curl, array(
    CURLOPT_URL =&gt; "http://www.healthos.co
  /api/v1/autocomplete/medicines/brands/CROCIN 125 MG SUSPENSION",
    CURLOPT_RETURNTRANSFER =&gt; true,
    CURLOPT_ENCODING =&gt; "",
    CURLOPT_MAXREDIRS =&gt; 10,
    CURLOPT_TIMEOUT =&gt; 30,
    CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST =&gt; "GET",
    CURLOPT_HTTPHEADER =&gt; array(
      "authorization" =&gt; "12b570970d786ebf07c85496f5d2a7212fca81799c93379c43066206b6780885"
    ),
  ));
  
  $response = curl_exec($curl);
  $err = curl_error($curl);
  
  curl_close($curl);
  
  if ($err) {
    echo "cURL Error:" . $err;
  } else {
    echo $response;
  }    
  </code></pre>
  
  <p><strong>here is my 100% genuine credentials:</strong></p>
  
  <p><strong>client id :</strong>   </p>
  
  <pre><code>faf4ad2651a7906fee8fab4c682ecc2721e16cc05771d8b32c807050ff621972
  </code></pre>
  
  <p><strong>Client Secret:</strong>   </p>
  
  <pre><code>eb6731289c24359adcc76a98ed643de0b6f48526a4d56071d9c9cdb3656c3a9a
  </code></pre>
  
  <p><strong>Access Token:</strong>  <code>12b570970d786ebf07c85496f5d2a7212fca81799c93379c43066206b6780885</code></p>
  
  <p><a href="https://i.stack.imgur.com/Z5dZg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z5dZg.png" alt="enter image description here"></a></p>
  
  <p><strong>please refer doccumentation</strong>:<a href="https://documenter.getpostman.com/view/2641261/healthos/6nATBN9#aa477f59-954c-744e-38dc-4e12a833fb70" rel="nofollow noreferrer">https://documenter.getpostman.com/view/2641261/healthos/6nATBN9#aa477f59-954c-744e-38dc-4e12a833fb70</a></p>