title: libcurl post - underscore replaced with space (ubuntu)
body: <p>I'm trying to send email and password in a post request to my express nodejs server using curl c++. The post data has '_' changed to ' ' when I log it from server.</p>
  
  <pre><code>    char emailtext[50];
      char passwordtext[50];
      int emailstrlen = wcstombs(emailtext, email-&gt;getText(), 50);
      int passwordstrlen = wcstombs(passwordtext, password-&gt;getText(), 50);
      long totalsize = emailstrlen + passwordstrlen;
      strcat(emailtext, ":");
      strcat(emailtext, passwordtext);
      // "myemail@yahoo.com:mypassword\0"
      curl_global_init(CURL_GLOBAL_ALL);
      CURLcode res;
      CURL* curl = curl_easy_init();
      curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
      curl_easy_setopt(curl, CURLOPT_URL, "https://localhost:3000/login");
      curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
      curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
      struct curl_slist *headers=NULL;
      headers = curl_slist_append(headers, "Content-Type:text/plain; charset=utf-8");
      cout &lt;&lt; emailtext &lt;&lt; endl;
      curl_easy_setopt(curl, CURLOPT_POSTFIELDS, emailtext);
      /* pass our list of custom made headers */
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      curl_easy_perform(curl); /* post away! */ 
      curl_slist_free_all(headers); /* free the header list */
      curl_global_cleanup();
      return true;
  </code></pre>
  
  <p>express nodejs server:</p>
  
  <pre><code>    app.post('/login', bodyParser.text(), function (req, res) {
           console.log("we got the post request for /login");
           console.log("logging the body!");
           console.log(req.body);
           res.header('Content-type', 'text/plain');
           return res.end('&lt;h1&gt;Hello, Secure World!&lt;/h1&gt;');
      });
  </code></pre>
  
  <p>say char* emailtext = "cool_stewj@yahoo.com:lololol"</p>
  
  <p>output from log on server will then be "cool stewj@yahoo.com:lololol"</p>
  
  <p>What's happening? I've tried url encoding the data which turned out to be silly and pointless. How do I get that underscore?</p>