cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: following server redirections

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 21 Jun 2005 10:43:50 -0700

On Tue, Jun 21, 2005 at 04:27:46PM +0200, C.Alvarez wrote:
> Hello,
>
> How does the redirection following is made ? Is this library able to follow 301
> or 302 server redirections ?

Yes.

> I have tried setting this
>
> curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
> curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 1);
> curl_easy_setopt(curl, CURLOPT_UNRESTRICTED_AUTH, 1);
>
> But this doesn't seems to redirect my page.
> here the testing url I have tried http://www.shopzilla.fr/mkt.xpml?mkt_id=
> 25925767

This URL doesn't result in a 301 or 302 redirect code--it results in a 200 OK
code with an HTML body containing an application-level
<META HTTP-EQUIV="refresh" ...> tag.

> Should I need to read the headers to get the redirections ?

It's not in the headers in this case. You'll have to parse the HTML
in your application in order to follow the redirect.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2005-06-21