cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Question about processing response headers.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 25 May 2012 23:40:52 +0200 (CEST)

On Fri, 25 May 2012, Yaşar Arabacı wrote:

> I am kind of new to using libcurl, and I couldn't figure out how to do
> something. I want to process response headers before moving into writing
> response body to a file. I want to do it because if content-type is
> attachment, I want to use filename from that header, otherwise, I want to
> come up with my own filename to write to. I can first make a head request
> with NOBODY option, and than make another request for actual response body.
> However, this makes two requests for each link I want to process, and I want
> to avoid that if possible.

It sounds as if you're looking for CURLOPT_HEADERFUNCTION.

-- 
  / daniel.haxx.se

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