Re: NSHTTPURLResponse
Re: NSHTTPURLResponse
- Subject: Re: NSHTTPURLResponse
- From: Scott Anguish <email@hidden>
- Date: Sun, 6 Jul 2003 16:04:12 -0400
On Sunday, July 6, 2003, at 1:55 PM, Koen van der Drift wrote:
Hi again,
Does anyone know how to use NSHTTPURLResponse? The docs give some info
but I am not sure what to do.
There is an additional document on line that outlines the differences
between NSURLConnection and NSURLDownload.
I am using NSURLDownload to get some data from a database. A possible
reply from the database is a 404 'not found' error. The receivedData
actually contains the complete html file that displays this 404 error,
so one thing I could do is search the text for an error. However,
NSHTTPURLResponse seems like a tool that is designed for this, making
life much easier for me.
NSURLDownload should return an error when it encounters anything like
a 404. NSURLConnection on the other hand does give you the redirected
content.
NSHTTPURLResponse will be the response from the server, without the
data.
if you implement -download:willSendRequest:redirectResponse: (there is
a known error in the doc narrative that refers to this as
responseRequest: BTW) then you can get the returned NSURLResponse for
the request, and check the type of the object, and if it is a
NSHTTPURLResponse, then check the status values...
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.