cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Windows98, PHP, CURL

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 26 Mar 2001 19:15:14 +0200 (MET DST)

On Mon, 26 Mar 2001, Csaba Gabor wrote:

[curl+php install on windows cut out]

Great. Thanks for that explanation, I hope that'll help a few others.

> The -I option does not work on my version of curl, either the command
> line version nor the php version downloaded two weeks ago. -I and -i
> seem to be synonymous, in both cases prepending the header information,
> but in neither case sending only the header information.

There is a differences, -I makes curl send HEAD while -i sends a GET. Still,
many servers sends a full page back even on HEAD requests (although the HTTP
rfc says they MUST NOT). Starting with the next release (of which there's a
beta right now), curl will only read the headers when a HEAD request is made,
and then stop reading, even if there's more data sent by the server.

> Several command line options (such as -I) are supposed to act as toggles.

Yes, they are.

> But I have not been able to understand this context because the command
> line allows only for curl [options ...] url so what is the point of
> toggling here (I assume I'm missing something pretty basic here).

The point is not really that big, I just chose to make it that way as you can
then set your own defaults in the .curlrc config file.

> I thought perhaps the -K config_file would be the perfect place for this
> where you specify options and can place a --url WebPage, but even in this
> way, I can only do a single page.

Multiple URLs on a single invoke should work decently with curl 7.5.1 and
later.

> It would be great if I could do sequences of pages this way, such as
> -D CookieFile
> --url http://my.favorite.domain/startpage.htm
> -b CookieFile
> --url http://my.favorite.domain/page2.htm
>
> Am I missing something?

No, only a minor thing. You can do this, but all the options will be used for
all the URLs. That is, your options could just as well be written in a
different order and they'd be used the same way (except for the actual URLs
that will be transfered in the given order). Of course, -D and -b _can_ use
the same file name without problems! ;-)

> Finally, I am running into a real problem for me with curl in the php
> version that is not a problem in the command line version. Php is very
> happy with curl until I tell it that I want to retrieve header
> information. At this point, I can't seem to block the page itself from
> being sent to stdout. I still have to run some more tests like perhaps
> directing the output to nul, so this one is just a heads up in case
> someone else has run into this.

Well, the fact that the actual "page itself" is passed on is as explained
above.

You probably need to set a file handle where to direct the page with
CURLOPT_FILE, or to use CURLOPT_RETURNTRANSFER to get the page returned.

> Sorry for any points I've missed. I'm a newbie with curl, but I love the
> program. Wonderful, Fantastic.

I hope I didn't ruin that impression! :-)

-- 
  Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/
_______________________________________________
Curl-and-php mailing list
Curl-and-php_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-and-php
Received on 2001-03-26