Re: How to validate a URL ?
From: Jeremy (jboschen_at_)
Date: 03/24/04
- Previous message: Ivan Brugiolo [MSFT]: "Re: new char[], delete [] causing a heap of trouble"
- In reply to: a.m.a: "Re: How to validate a URL ?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 24 Mar 2004 17:35:00 -0500
If you have control over what verbs the server software allows, then the
most efficient method is to use the HTTP HEAD method to request headers,
from which you can extract whatever information about the resource you
require. To do this, use one of the various INet API's, WinINet, WinHTTP,
ATL's HttpClient, etc. If you don't have control over the verbs, then most
likely they're still being allowed as very few people change them.
For info on the HEAD method, see:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.4
- Jeremy
"a.m.a" <amarcaurele@videotron.ca> wrote in message
news:0qm8c.100609$9p2.2075469@weber.videotron.net...
>
> "CheckAbdoul" <checkabdoul at mvps dot org> wrote in message
> news:%2307YUGREEHA.3064@tk2msftngp13.phx.gbl...
> > You could probably use the IsValidURL() API from the Internet
> > Development SDK.
> >
> > --
> > Cheers
> > Check Abdoul [VC++ MVP]
> > -----------------------------------
> >
> > "a.m.a" <amarcaurele@videotron.ca> wrote in message
> > news:CA08c.60227$9p2.1141759@weber.videotron.net...
> > > Hi
> > >
> > > Whats the best way to find out if a URL is valid ?
> > >
> > > The method should validate if the path points to a file data
> > > even if the path is not an absolute path name, ex ::
> > > www.asd.com/cgi#q98we7q97
>
> Thanks, but i dont think that this method will check the remote data's
> availability.
> I need more then a URL syntax checker, i also need the method to check if
> the
> remote file exists. I have objects that downloads data using a
> IBindStatusCallBack.
> But i dont want to create these if the file does not exist.
>
>
>
>
>
>
- Previous message: Ivan Brugiolo [MSFT]: "Re: new char[], delete [] causing a heap of trouble"
- In reply to: a.m.a: "Re: How to validate a URL ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|