cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl and streaming data from push server

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 2 Mar 2009 09:44:21 +0100 (CET)

On Sun, 1 Mar 2009, Z Sun wrote:

> How can I simply implement whatever curl is doning with "-o - -N"
> options using libcurl?  

You're already doing it:

>   int main(void)
>   {
>    CURL *curl;
>    CURLcode res;
>  
>    curl = curl_easy_init();
>    if(curl) {
>      curl_easy_setopt(curl, CURLOPT_URL, "push server address");
>      res = curl_easy_perform(curl);
>   
>      /* always cleanup */
>      curl_easy_cleanup(curl);
>    }
>     return 0;
>   }

You can of curse use "curl --libcurl example.c [url]" to get a decent initial
set of options for the exact command line you use.

"-o - -N" really is no magic at all...

-- 
  / daniel.haxx.se
Received on 2009-03-02