cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: can curl output to a string?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 15 Nov 2000 08:29:55 +0100 (MET)

On Tue, 14 Nov 2000, Eduardo Reis wrote:

> And in C can I put curl's output in a string? Or I need to write it
> always to file?

Are you talking about using libcurl now or simply curl?

If you invoke curl from within a C program, you could fetch the stdout from
curl and put that in an internal buffer, sure.

If you use libcurl from a C program, your callback function should append the
data to either a single large buffer that you realloc() when needed or you
could make it add a node to a linked list or something.

From a C program, I'd recommend using libcurl directly.

-- 
  Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/
Received on 2000-11-15