• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Determining if a url exists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Determining if a url exists (From: Matthew Delves <email@hidden>)

  • Prev by Date: Re: Determining if a url exists
  • Next by Date: Fwd: PubSub, enclosures and "Couldn't find PSFeed of PSEntry"
  • Previous by thread: Re: Determining if a url exists
  • Next by thread: Re: Determining if a url exists
  • Index(es):
    • Date
    • Thread