Re: Determining if a url exists
Re: Determining if a url exists
- Subject: Re: Determining if a url exists
- From: Nir Soffer <email@hidden>
- Date: Thu, 7 Feb 2008 10:17:46 +0200
On Feb 7, 2008, at 07:47, Matthew Delves wrote:
An app that I'm writing involves fetching of rss feeds. To get
around caching I have been appending ?20080207 (or whatever the
current date is) to the URL. Unfortunately some server's don't like
this and will return a 404. Is there a way using cocoa to determine
if a URL will return a 404?
Is there a way to determine the future?
The only way is to fetch the url, and check the http status code
returned. Checking for 404 is NOT enough; the server may return many
other status codes relevant to your needs. It is more correct to
check for 200 OK. If you need to support redirects, you will also
have to check for the few redirection status codes (30X).
See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.
Best Regards,
Nir Soffer
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden