cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Behavior of -D and -c options in curl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 16 Jan 2007 13:30:52 +0100 (CET)

On Tue, 16 Jan 2007, imran shaik wrote:

> I see that the older versions(7.9.8 the oldest one I have) of curl read from
> the headers file without -b .

Uhm, I think I don't understand. curl has never read from any headers file
without you telling it to.

> But the newer versions(7.14) do require -b. I observed this in case of 2 or
> 3 redirects.

Are you referring to the need to use -b (or -c) to activate cookie parsing on
incoming headers? That was always the case and curl has never parsed cookies
without you telling it to.

> Am I correct ?

Not if I understand you correctly.

> Can I know what is the additional information stored with -c?

Read the output file, it is in netscape/mozilla/firefox cookie jar format. It
contains for example host/domain and more that the headers do not
(necessarily) contain.

> Is only the additional information that makes -c more preferable than -D

"only" ? -c makes a perfect cookie jar of all existing known cookies
(including those that was read previously with -b), while -D is a "mere"
header dump. That's quite some difference. If managing cookies is your game,
then -c is a must and -D for the laymen. ;-)

> Also, in case of -L does -c forces all the cookies to be written at the end
> of all redirects?

No.

> Does -D dumps for each URL or at the end of handling all the URLs?

-D dumps all headers as they come in. If -L follows 488 redirects, you will
get 488 set of headers dumped to the file.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-01-16