Re: How to know HTTP server is down

Giganews Newsgroups
Subject: Re: How to know HTTP server is down
Posted by:  Arvid (Indy Core Team) (nospam@nospam.org)
Date: Wed, 03 Feb 2010

Hi Alan,

On 02.02.2010 00:13, Alan T wrote:
> I want to test if HTTP server is up and running before GET a file.
> I cannot GET the file for testing the HTTP server is running because the
> file is not always existing.
>
> One way is to put a dummy file on HTTP server if I can GET the file, any
> other way I can test beside GET a file from HTTP server?

You could either

1) ping the server (Attn: Indy PING does require administrative rights
due to MS and it's used RAW socket)

2) Do a IdHTTP.Head to the root directory of the HTTP Server. If the
server is running it should always return something. If it fails you can
check the raised Exception for a more detailed reason like i.e. a TimeOut.

- Arvid

Replies

In response to

How to know HTTP server is down posted by Alan T on Tue, 2 Feb 2010