On Sun, Jul 27, 2008 at 5:23 PM, Joe N. <jnardone_at_gmail.com> wrote:
> curl_easy_setopt(m_curl, CURLOPT_URL, url);
>> m_res = curl_easy_setopt(m_curl, CURLOPT_NOPROGRESS, 1L);
>> m_res = curl_easy_setopt(m_curl, CURLOPT_WRITEFUNCTION,write_to_buffer);
>> curl_easy_setopt(m_curl, CURLOPT_WRITEDATA, &buffer);
>> curl_easy_setopt(m_curl, CURLOPT_POSTFIELDS, data);
>> the function write_to_buffer appends all chars to string element (string
>> data is a simple url post format (ex :
> The POST response is in the buffer being written to by "write_to_buffer".
> If you aren't seeing it there, then there's probably something up in your
> buffer function.
I used this function :
static size_t write_to_buffer(void *ptr, size_t size, size_t nmemb, void
if (stream == NULL)
((std::string *) stream)->append((const char *)ptr,size * nmemb);
return size * nmemb;
and according to the samples (examples) it is preety close to it.
Received on 2008-07-27