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

curl-and-php

Re: CURLOPT_NOBODY behavior

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 7 Apr 2008 07:42:56 +0200 (CEST)

On Sun, 6 Apr 2008, Shailesh N. Humbad wrote:

> The reason I suggested to change the "true" behavior was to make the option
> more like an "on/off" switch, which only affects how cURL handles body
> content. However, that would both break existing code and not optimize the
> HTTP request to get a header only. Therefore, it is probably better to, as
> you said, make the "false" behavior have no effect.

Actually it struck me that false can't be entirely left with no effect, since
we have protocols (non-HTTP) for which CURLOPT_NOBODY doesn't mean a change of
keyword but only is a flag that prevents libcurl from getting the actual body.

So, I've now made the code treat FALSE so that it re-enables reading the body
and it does switch back the http request to use to GET - to prevent it from
accidentally doing bad requests. Possibly I should rather only change the
method to GET if it still is set to HEAD...

Thanks for your feedback in this matter!

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-04-07