How to evaluate 403 Forbidden?

Discussion in 'iOS Programming' started by lawicko, Sep 4, 2008.

  1. lawicko macrumors member

    Jul 17, 2008
    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.
  2. DipDog3 macrumors 65816


    Sep 20, 2002
    I don't understand. What are you looking to do if given a 403 error?
  3. drivefast macrumors regular

    Mar 13, 2008
    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.
  4. lawicko thread starter macrumors member

    Jul 17, 2008
    Thanks! This is exactly what I was looking for :)

Share This Page