cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: return code after a 404

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 1 Feb 2006 15:39:28 +0100 (CET)

On Wed, 1 Feb 2006, Michael.Renner_at_dab.com wrote:

> even if curl returns with a 404 error curl returns with the value '0' to the
> shell. But I need the propper returncode to decide what's next in my script.

"The proper" ? 404 is not an error in curl's view, it is just another HTTP
response code and you get a "file" back and everything.

Anyway, you can make curl "fail" on >= 400 reponse codes with -f, and/or you
can extract the response codes with -w.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-02-01