title: Curl returns 400 bad request (url with spaces)
body: <p>When i use curl library and try to get image from url i get 400 bad request error.
  I founded that problem is with encoding url.
  But in my case it's not work, because my url - it's path to image on server side - like</p>
  
  <pre><code>http://example.com/images/products/product 1.jpg
  </code></pre>
  
  <p>I understand that user spaces in name files it's bad practice, but it's not my server and not i created those files.</p>
  
  <pre><code>$ch = curl_init();
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_URL, urlencode($url));
  echo $ret = curl_exec($ch);
  </code></pre>
  
  <p>When i use urlencode function - curl return http_code = 0</p>
  
  <p><strong>Updated</strong></p>
  
  <pre><code>$url = str_replace(' ', '+', $url);
  </code></pre>
  
  <p><strong>doesn't work, server return 404 error.</strong></p>