try with this
curl_easy_setopt(hcurl, CURLOPT_WRITEFUNCTION, write_callback);
curl_easy_setopt(hcurl, CURLOPT_WRITEDATA, stdout);
but before that u have to define write_callback function like below...
size_t write_callback(void *ptr, size_t size, size_t nmemb, void *stream)
{
size_t len = size * nmemb;
struct Response *reply = (struct Response *)stream;
reply -> str = (char *) responserealloc(reply -> str ,(reply -> size + len
+ 1));
if(reply -> str)
{
memcpy(&(reply -> str[reply -> size]),ptr,len);
reply -> size += len;
reply -> str[reply -> size] = 0;
}
return (len);
}
regards,
Ranjeet
----- Original Message -----
From: "???" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, October 17, 2008 11:50 AM
Subject: [cURLpp] How to recieve header and body text into string
bufferwithout printout
> hi. all..
> i am writing some app with libcurl
> unfortunately, i am not a good programmer.
> i have stopped because of small problem.
> here are my partial source codes.
> i want to header and body text not to be printed out.
> help me..
>
> size_t receiveData(void *ptr, size_t size, size_t nmemb, void *stream)
> {
> // do something.
>
> return size;
> }
>
> curl_easy_setopt(hCurl, CURLOPT_HEADERFUNCTION, receiveData);
>
> curl_easy_setopt(hCurl, CURLOPT_WRITEFUNCTION, receiveData);
>
> curl_easy_setopt(hCurl, CURLOPT_WRITEHEADER, stdout);
> curl_easy_setopt(hCurl, CURLOPT_WRITEDATA, stdout);
>
>
> thanks in advance..
> _______________________________________________
> cURLpp mailing list
> [email protected]
> http://www.rrette.com/mailman/listinfo/curlpp
>
_______________________________________________
cURLpp mailing list
[email protected]
http://www.rrette.com/mailman/listinfo/curlpp