cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How can i get the answer from a post ?

From: Joe N. <jnardone_at_gmail.com>
Date: Sun, 27 Jul 2008 10:23:07 -0400

> 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);
> curl_easy_perform(m_curl);
>
> the function write_to_buffer appends all chars to string element (string
> buffer).
> data is a simple url post format (ex :
> "parent_pid=&format=text&code2=I+don't+know+how+to+get+answers+using+libcurl&poster=Jabka+Atu&paste=Send&expiry=m&email="
>
>
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.

Joe
Received on 2008-07-27