cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl and squid

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 20 Feb 2003 21:31:21 +0100 (CET)

On Thu, 20 Feb 2003, Santiago Gallego wrote:

> Can't get it to work. I use this piece of code trying to do that:
>
> curl_slist slist;
> curl_slist_free_all(&slist);
> curl_slist_append(&slist,"pragma:");
> curl_easy_setopt(curlHandler,CURLOPT_HTTPHEADER,&slist);

Try it this way:

  curl_slist *slist=NULL;
  slist = curl_slist_append(slist, "pragma:");
  curl_easy_setopt(curlHandler, CURLOPT_HTTPHEADER, slist);

  [then perform]

  curl_slist_free_all(slist);

I just checked, and the man page for curl_slist_append() is painfully bad!
;-)

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
Received on 2003-02-20