cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HEAD request with POST data

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 30 Jun 2004 13:04:55 +0200 (CEST)

On Tue, 29 Jun 2004, Niels van Tongeren wrote:

> For the POST request we set the CURLOPT_POSTFIELDS, CURLOPT_POSTFIELDSIZE
> and CURLOPT_POST options. For the HEAD request we set the CURLOPT_NOBODY
> option to '1'.

This patch seems to fix the problem for me:

diff -u -r1.397 url.c
--- url.c 24 Jun 2004 09:14:59 -0000 1.397
+++ url.c 30 Jun 2004 11:03:53 -0000
@@ -488,6 +488,9 @@
       * Do not include the body part in the output data stream.
       */
      data->set.opt_no_body = va_arg(param, long)?TRUE:FALSE;
+ if(data->set.opt_no_body)
+ /* in HTTP lingo, this means using the HEAD request */
+ data->set.httpreq = HTTPREQ_HEAD;
      break;
    case CURLOPT_FAILONERROR:
      /*

(about to be committed to CVS right now)

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-06-30