cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Simple Redirection Problem

From: Michel Barakat <bmichel_at_gmail.com>
Date: Mon, 29 Sep 2008 20:46:24 +0200

Thanks for your reply.

I removed CURLOPT_REFERER and tried the following:
curl_easy_setopt(curlHandle, CURLOPT_AUTOREFERER, 1L);

However, it didn't do the trick and it is still fetching the first page.
Here is the url in question:
http://news.bbc.co.uk/1/low/programmes/from_our_own_correspondent/7637282.stm

On Mon, Sep 29, 2008 at 7:45 PM, Dan Fandrich <dan_at_coneharvesters.com> wrote:
> On Mon, Sep 29, 2008 at 07:18:43PM +0200, Michel Barakat wrote:
>> I'm using the libcurl for C++, and I am facing a small problem.
>> I'm trying to fetch a page (the first page) which redirects to the
>> another page (the second page).
>> The problem is that I'm reaching the first page instead of the second page.
>>
>> The following is set:
>> curl_easy_setopt(curlHandle, CURLOPT_FOLLOWLOCATION, 1);
>>
>> I've tried the following without success:
>> curl_easy_setopt(curlHandle, CURLOPT_AUTOREFERER, 1);
>> curl_easy_setopt(curlHandle, CURLOPT_REFERER, ";auto");
>>
>> >From the command line, I was able to get the second page by doing:
>> curl -e ";auto" <page_to_fetch>
>>
>> I can't figure out though what's the equivalent of -e ";auto" in libcurl.
>> Any thoughts?
>
> ";auto" in the command line is translated into the CURLOPT_AUTOREFERER, so
> you shouldn't need to do anything more. Just remove the CURLOPT_REFERER
> option altogether. Note that those integers should be longs, so pass in "1L"
> instead of just "1".
>
>>>> Dan
> --
> http://www.MoveAnnouncer.com The web change of address service
> Let webmasters know that your web site has moved
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
> FAQ: http://curl.haxx.se/docs/faq.html
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2008-09-29