• 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: CFNetwork and 404
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFNetwork and 404


  • Subject: Re: CFNetwork and 404
  • From: Ricky Sharp <email@hidden>
  • Date: Mon, 3 May 2004 18:41:47 -0500

On May 3, 2004, at 6:29 PM, Ricky Sharp wrote:


On Apr 29, 2004, at 8:20 PM, Trygve Inda wrote:

I am using the CFNetworkHTTPDownload example. In my ReadStreamClientCallBack
function, if I have specified a bad url (expecting a 404), I never seem to
get an error.

I get the OpenStram event, and then nothing. How can I get a 404 error (or a
"server not found" error).

I've been looking at that example myself and have just made a first pass at integrating it into my app.

If I specify a bad URL (e.g. non-existent domain), I do get a kCFStreamEventErrorOccurred in my callback. However, if I use a good domain, but non-existent resource (e.g. misnamed .html file), I only get kCFStreamEventEndEncountered.

Accidentally sent the message too early...

I wanted to add that I also would be curious as to get the details on what the failure was. The APIs though seem a bit high-level in places (which is a good thing if you don't care about the details).

Perhaps the CFHTTPMessageGetResponseStatusCode method can provide the details. The response you feed it is of type CFHTTPMessageRef and I think you can obtain that by using the kCFStreamPropertyHTTPResponseHeader property name with CFReadStreamCopyProperty.

In terms of why a missing resource doesn't generate an error, I would think that would be a bug. Although, I want to check that status code property to see if it would have the 404.

___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Founder & President
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: CFNetwork and 404
      • From: Becky Willrich <email@hidden>
References: 
 >Re: CFNetwork and 404 (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: CFNetwork and 404
  • Next by Date: Re: CFNetwork and 404
  • Previous by thread: Re: CFNetwork and 404
  • Next by thread: Re: CFNetwork and 404
  • Index(es):
    • Date
    • Thread