5 Jul 2012 11:40
no output wanted (resend)
Jakob Hirsch <jh <at> plonk.de>
2012-07-05 09:40:31 GMT
2012-07-05 09:40:31 GMT
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
RSS Feed