curl-library
Re: Problem with GET
Date: Wed, 18 Jul 2007 16:16:48 -0700
Dan Fandrich wrote:
> On Wed, Jul 18, 2007 at 03:58:56PM -0700, James Woo wrote:
>
>> I'm new to libcurl. After using curl_easy_setopt (ctx,
>> CURLOPT_WRITEFUNCTION, write_callback) to
>> retrieve the web page. I would like to send a http "GET" message with the
>> info from the web page.
>> I tried curl_easy_setopt(ctx, CURLOPT_READFUNCTION, read_callback) to send
>> the http message.
>> But the read_callback function is never called. What did I do wrong here?
>>
>
> How are you retrieving the original web page. With a "GET" request, most
> likely. You can read the next web page in exactly the same manner. You
> will need to ensure that the URL contains any necessary parameters you
> retrieved from the first web page.
>
>
curl_global_init(CURL_GLOBAL_ALL);
ctx = curl_easy_init();
curl_easy_setopt (ctx, CURLOPT_WRITEFUNCTION, write_callback);
curl_easy_setopt (ctx, CURLOPT_URL, "http://172.30.2.164/xxx/yyy/");
curl_easy_perform (ctx);
Got my first web page in the write_callback function.
curl_easy_setopt (ctx, CURLOPT_READFUNCTION, read_callback);
curl_easy_perform (ctx);
Nothing happened.
Received on 2007-07-19