title: Pipe data from curl_easy_perform
body: <p>I am trying to use libcurl to pipe data from an arbitrary (user given) url to my application:</p>
  
  <ul>
  <li>The <a href="http://curl.haxx.se/libcurl/c/https.html" rel="nofollow">https.c</a> example shows how to retrieve content from a URL and immediately write it to somewhere as it comes in, for example stdout or a file.</li>
  <li>The <a href="http://curl.haxx.se/libcurl/c/sendrecv.html" rel="nofollow">sendrecv.c</a> example shows how to setup a pipe by making the application repeatedly call <code>curl_easy_recv</code> to retrieve chunks of data. </li>
  </ul>
  
  <p>However I don't understand how to combine the two. It seems like <code>curl_easy_recv</code> only works when:</p>
  
  <pre><code>/* Do not do the transfer - only connect to host */ 
  curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
  </code></pre>
  
  <p>When this option is set <code>curl_easy_perform</code> does not retrieve any data, it just connects. In the example, the application proceeds by manually sending an http command using <code>curl_easy_send</code>. However I just want to retrieve the data specified in the URL, without writing manual http or ftp commands.</p>
  
  <p>Is there a way to use <code>curl_easy_recv</code> or something similar in combination with the default behavior of <code>curl_easy_perform</code> automatically taking care of retrieving the content specified in the url?</p>