curl-library
Re: HTTP ping
From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 4 Dec 2007 10:42:16 -0800
Date: Tue, 4 Dec 2007 10:42:16 -0800
On Tue, Dec 04, 2007 at 09:50:35AM -0300, Gonzalo Diethelm wrote:
> Using libcurl 7.16.4 on Ubuntu 7.10 and Windows XP SP2.
>
> I need to verify whether the server I will download something from (using HTTP
> / HTTPS) is accepting requests. What would be the best way to do this with
> curl, so that it transmits as little data as possible (both ways) and, in case
> of any failure (network not up, cannot resolve host name, timeout, etc.)
> returns an error status as quickly as possible?
You can do a HEAD request on a known good URL and specify a timeout that
will catch network errors.
>>> Dan
-- http://www.MoveAnnouncer.com The web change of address service Let webmasters know that your web site has movedReceived on 2007-12-04