cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: http code output

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Mon, 24 Jan 2005 20:32:53 +0100 (CET)

On Mon, 24 Jan 2005, Andreas Rütten wrote:

> I use curl with the switches -s -S -f -w %{http_code} so that the only
> output i get is the http status code.

None of these options disables the regular output, so you will get the HTML
too sent to stdout if the server provides any.

> But if i recieve a http code 201 I get also the html document on the stdout.

You will get HTML to stdout if the server sends it, no matter what HTTP code
it returns.

> I hope anyone can solve my confusion

Use "> dump", -o /dev/null or similar to redirect the HTML to a controlled
place or file.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2005-01-24