cURL / Mailing Lists / curl-library / Single Mail

curl-library

no output wanted (resend)

From: Jakob Hirsch <jh_at_plonk.de>
Date: Thu, 05 Jul 2012 11:40:31 +0200

Hi,

is there a simple way to make curl_easy_perform() not to output any
data? I just want to HTTP-POST something to a web interface and are not
interested in the server's reply.

I first thought maybe setting CURLOPT_WRITEDATA to NULL could do the
trick, but then libcurl simply segfaults (for obvious reasons).
Setting CURLOPT_NOBODY also does not work, it seems to force the use of
HEAD, regardless if set CURLOPT_HTTPPOST before or after it. (Even
though the spec says "When setting CURLOPT_HTTPPOST, it will
automatically set CURLOPT_NOBODY to 0 (since 7.14.1)." and I'm using
7.26.0, but that's a different story.)

Right now I help myself by using a dummy function with
CURLOPT_WRITEFUNCTION that just returns size*nmemb to make libcurl
happy. That's work fine, but it seems to me quite cumbersome (and a
waste of resources, albeit a small one).

Anything I missed?

Regards,
Jakob
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-07-05