title: Empty value when converting CURL to string
body: <p>I would like to get source code of a page, I have this function to populate a string.</p>
  
  <p>My header file :</p>
  
  <pre><code>class Explorateur {
  public:
      Explorateur();
      ~Explorateur();
      std::string RecupererCodeSource(std::string pAdresse);
  
      static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp)
      {
          ((std::string*)userp)-&gt;append((char*)contents, size * nmemb);
          return size * nmemb;
      }
  
  };
  </code></pre>
  
  <p>My class file :</p>
  
  <pre><code>std::string Explorateur::RecupererCodeSource(std::string pAdresse)
  {
        CURL *curl;
        CURLcode res;
        std::string readBuffer;
  
        curl = curl_easy_init();
        if(curl)
        {
          curl_easy_setopt(curl, CURLOPT_URL, pAdresse);
          curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
          curl_easy_setopt(curl, CURLOPT_WRITEDATA, &amp;readBuffer);
          std::cout &lt;&lt; "curl  : " &lt;&lt; curl &lt;&lt; std::endl;
          res = curl_easy_perform(curl);
          std::cout &lt;&lt; "res  : " &lt;&lt; res &lt;&lt; std::endl;
          curl_easy_cleanup(curl);
  
        }
        std::cout &lt;&lt; "Read : " &lt;&lt; readBuffer &lt;&lt; std::endl;
        return readBuffer;
  }
  </code></pre>
  
  <p>My main :</p>
  
  <pre><code>int main()
  {
      Explorateur explorateur;
      std::string valeur = explorateur.RecupererCodeSource("https://www.google.com/");
      return 0;
  }
  </code></pre>
  
  <p>The result is not excepted, it's empty, do you have an idea why ?</p>
  
  <pre><code>curl  : 0x1450d60
  res  : 6
  Read :
  </code></pre>