cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: easy_peform return Code ?

From: Casey ODonnell <caseyodonnell_at_gmail.com>
Date: Fri, 10 Sep 2004 08:47:38 -0400

I use something like:

        if(Perform())
        {
                GetInfo(CURLINFO_RESPONSE_CODE, &m_iResponseCode);

                return ((m_iResponseCode > 199) && (m_iResponseCode < 300));
        }

        return false;

you could of course make it more specific to your code, but I like
booleans, so I just make sure I get a 'OK' type of response (200 range
for HTTP). It's only a couple more lines of code.

Cheers.

On Fri, 10 Sep 2004 11:00:38 +0200, Linus Nielsen Feltzing
<linus_at_haxx.se> wrote:
> Ram wrote:
>
> > Can i get 404 Not found as the returned value of curl_easy_perform ( ) .
>
> No, but you can call curl_easy_getinfo() to get the HTTP error code.
>
> See here:
>
> http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html
>
> Linus
>
>

-- 
Casey O'Donnell
RPI STS Department - Graduate Student
http://homepage.mac.com/codonnell/
http://homepage.mac.com/codonnell/wxsync/
http://homepage.mac.com/codonnell/wxblogger/
Received on 2004-09-10