PDA

View Full Version : How to evaluate 403 Forbidden?




lawicko
Sep 4, 2008, 04:43 AM
Hi,
I'm using UIWebView in my application, and I would like to learn how can I evaluate 403 Forbidden error. I know it is possible, because native Safari can do this (you can see 403 Forbidden title when this happens). Unfortunately, I couldn't find any clues in UIWebView class documentation. I know that there is a method called webView:didFailLoadWithError: but it evaluates different kind of errors i.e. no connection and so on. If I got 403 error in my app the page is loaded sucessfully showing "Forbidden... bla bla bla" and nothing happens.

Thanks for any clues.



DipDog3
Sep 4, 2008, 08:39 AM
I don't understand. What are you looking to do if given a 403 error?

drivefast
Sep 4, 2008, 10:11 AM
did you tried receiving your data into a NSURLResponse / NSURLHTTPResponse? although if youre looking to capture the 403 for authentication purposes, there may be better ways of doing that. there's an article on the iphone ADC called "URL loading system", with pretty good recipes, maybe you can find what you're looking in there.

lawicko
Sep 5, 2008, 04:52 AM
Thanks! This is exactly what I was looking for :)