cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTPS POST

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 9 May 2006 15:12:53 -0700

On Tue, May 09, 2006 at 05:45:22PM -0400, Alex Kelly wrote:
> I didn't know about CURLINFO_RESPONSE_CODE, but I just looked it up. Looks
> like it returns 1 or 0 (if I read it right). So, testing the value is an
> easily coded check.

No, it returns the HTTP response code. This should be 200-299 on success or
some other value on failure.

> So far, I've been dividing the results of curl_easy_perform using a loop
> with strtok and the newline character, '\n'. I could make an if statement
> using strstr to look for the string "not authorized" or whatever the
> remote server is returning on failure in the results (worth a shot).

This isn't nearly as reliable since the server could change its output
at any time.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2006-05-10