cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Effective URL different if CURLOPT_NOBODY is set to true

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 17 Mar 2009 19:40:48 +0100 (CET)

On Tue, 17 Mar 2009, Lindsay Ohman wrote:

> When I try and retrieve the effective URL from one that is redirected, but I
> do curlopt_nobody set to true - it returns a different effective URL than
> one if I set nobody to false.

Then the server obviously is presenting you different Location: headers
depending on the request method. GET vs HEAD.

> Is that how it's supposed to work?

libcurl shows you what the server says. That's what it is supposed to do.

> I need the one that is retrieved with nobody set to false, but I don't want
> to retrieve the whole file. Can you help?

How about stopping the transfer immediately after the headers have been
received?

-- 
  / daniel.haxx.se
Received on 2009-03-17