cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Only retrieve the headers of a GET reply and return?

From: David Strauss <david_at_davidstrauss.net>
Date: Thu, 11 Apr 2013 13:40:10 -0700

On Thu, Apr 11, 2013 at 12:37 PM, Mohammad_Alsaleh <msal_at_tormail.org> wrote:
> Is there a simple clean way to only retrieve the headers of a GET reply
> and return without retrieving the data.

You can certainly set (1) a CURLOPT_HEADERFUNCTION that stores header
data, (2) a CURLOPT_WRITEFUNCTION that simply returns the number of
bytes sent in, and (3) CURLOPT_PROGRESSFUNCTION (with
CURLOPT_NOPROGRESS set to zero) to cancel after the body starts. Part
#3 is optional.

--
David Strauss
   | david_at_davidstrauss.net
   | +1 512 577 5827 [mobile]
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2013-04-11