title: Why do I get a CURLE_URL_MALFORMAT when trying to http post?
body: <p>Here's the code (extracted from an existing application):</p>
  
  <pre><code>CURL *curl = curl_easy_init();
  _ASSERTE(curl);
  
  string url = "http://127.0.0.1:8000/";
  
  char *data = "mode=test";
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
  curl_easy_setopt(curl, CURLOPT_URL, url);
  CURLcode res = curl_easy_perform(curl);
  
  bool success = (res == CURLE_OK);
  
  curl_easy_cleanup(curl);
  </code></pre>
  
  <p>The value of <code>res</code> is <code>CURLE_URL_MALFORMAT</code>. Is this URL not compatible with curl?</p>