[Qt-interest] validate url using QHttp

Ross Driedger ross at earz.ca
Wed Nov 11 01:23:23 CET 2009


On Tue, 10 Nov 2009 18:59:35 -0500, <qt-interest-request at trolltech.com>  
wrote:

> Message: 1
> Date: Wed, 11 Nov 2009 01:12:16 +0200
> From: Mystical Groovy <mysticalgr at gmail.com>
> Subject: [Qt-interest] validate url using QHttp
> To: "qt-interest at trolltech.com" <qt-interest at trolltech.com>
> Message-ID:
> 	<4877b36e0911101512n70cbee40i5acb23444cafea71 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> Hello all,
> Im using QFtp and errorString() to see if its an ftp repository is live,  
> for
> ex if errorString returns no error, the host is alive, else theres a  
> problem
> //check ftp vadility

There is a big difference between ftp and http: the first is 'stateful'  
and the other is 'stateless'.  In short, you can set up an http connection  
to an invalid address, but you won't be aware that it is invalid until you  
try to get any data from it.  For ftp, the client and server negotiate the  
connection before you try to transfer files.

Try a GET to an invalid URL and see what happens.

Here is a good start to the necessary reading you will need to really  
understand what is happening:
<http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol>

-- 
"Opera is when a guy gets stabbed in the back and, instead of bleeding, he  
sings. "
Ed Gardner

Ross Driedger
ross_at_earz.ca



More information about the Qt-interest-old mailing list