cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Simple HTTP PUT - response content printed to screen

From: Joe Lorenz <joe.lorenz_at_plexxi.com>
Date: Sat, 26 Jan 2013 06:54:25 -0500

On 1/26/13 4:37 AM, Dan Fandrich wrote:
> On Fri, Jan 25, 2013 at 05:37:11PM -0500, Joe Lorenz wrote:
>> I'm having this problem when using libcurl in my own (Linux) app, but
>> I can demonstrate the same problem using the curl tool.
>> If a simple HTTP file upload (presumably a 'PUT'), and the file gets
>> created at the destination, the response content is printed to
>> screen:
>
> Writing output to stdout is libcurl's default behaviour. If that's not what
> you want, then install a CURLOPT_WRITEFUNCTION handler and do something
> else with the data.
>
>>>> Dan

Oh. I hadn't considered that since a 201 or a 200 response doesn't get printed
and nothing prints out for a GET or file transfers with other protocols.
I'll set up a CURLOPT_WRITEFUNCTION handler and go from there.
Thanks for the help.

        -Joe
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-01-26