[Qt-interest] validate url using QHttp

Mystical Groovy mysticalgr at gmail.com
Wed Nov 11 14:38:19 CET 2009


thank you all for your answers i did it :)

2009/11/11 Markus Goetz <Markus.Goetz at nokia.com>

> ext Ross Driedger wrote:
> > 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>
> >
> >
> Ross is right. What you could do is use QNetworkAccessManager and use
> the HTTP HEAD method with its head() function and then look for error()
> signal and finished() signal if it succeeds.
>
> Markus
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091111/5f9f60b9/attachment.html 


More information about the Qt-interest-old mailing list