cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Errorlevels

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 8 Jan 2001 08:32:22 +0100 (MET)

On Sun, 7 Jan 2001, Frank Reid wrote:

> First, thanks for the great work with curl. It's truly a very handy
> utility and a great piece of programming.

Thanks for your kind words.

> 1) Is the "--http-request DELETE" argument fully implemented in the
> current version? I didn't see anything about it in the man or README.

That is the old name, it is currently named --request instead and you may use
DELETE in a way similar to:

        curl --request DELETE http://that.site.com/removefile.html

Yes, it is fully implemented. Feel free to suggest how this can be added
properly to the documentation.

> 2) The documentation provides an extensive listing of errorlevels for
> failure. Where and when are these returned?

They're all typedef'ed enums named CURLcode. All functions that are defined
to receive such a variable can receive one of those return codes.

The curl tool is made to return the (last) return code from
curl_easy_perform() to whoever invoked it (most likely a shell).

> It appears "res" in main() always contains '0' whether the operation
> succeeds or fails. (I'm trying to run things under Win32, if that's
> significant.)

curl_easy_perform() returns different return codes depending on the cause of
its failure. I think you're seeing something wrong if that return code is
always 0. Just make it do an error and single-step through the code to find
out exactly why/how.

-- 
  Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/
Received on 2001-01-08